[][src]Macro embedded_crc_macros::crc8_lookup_table

macro_rules! crc8_lookup_table {
    ($function_name:ident, $initial_value:expr, $doc:expr) => { ... };
}

Define public function implementing the CRC-8 algorithm for the given polynomial and initial value using a lookup table.

This implementation is much faster at the cost of some space. A function name and some documentation for it must be provided.

The lookup table can be generated in the build.rs file with the build_rs_lookup_table_file_generation macro and then included like in the following example.

use embedded_crc_macros::crc8_lookup_table;
// include!(concat!(env!("OUT_DIR"), "/lookup_table.rs"));
crc8_lookup_table!(pec, 0, "SMBus Packet Error Code");