This struct can help you compute a CRC value.
pub fn create_crc(
poly: u64,
bits: u8,
initial: u64,
final_xor: u64,
reflect: bool
) -> CRC
[src]
Create a CRC instance by providing the length of bits, expression, reflection, an initial value and a final xor value.
pub fn create_crc_u8(
poly: u8,
bits: u8,
initial: u8,
final_xor: u8,
reflect: bool
) -> CRC
[src]
Create a CRC instance by providing the length of bits, expression, reflection, an initial value and a final xor value.
pub fn create_crc_u16(
poly: u16,
bits: u8,
initial: u16,
final_xor: u16,
reflect: bool
) -> CRC
[src]
Create a CRC instance by providing the length of bits, expression, reflection, an initial value and a final xor value.
pub fn create_crc_u32(
poly: u32,
bits: u8,
initial: u32,
final_xor: u32,
reflect: bool
) -> CRC
[src]
Create a CRC instance by providing the length of bits, expression, reflection, an initial value and a final xor value.
pub fn create_crc_u64(
poly: u64,
bits: u8,
initial: u64,
final_xor: u64,
reflect: bool
) -> CRC
[src]
Create a CRC instance by providing the length of bits, expression, reflection, an initial value and a final xor value.
pub fn digest<T: ?Sized + AsRef<[u8]>>(&mut self, data: &T)
[src]
pub fn get_crc(&mut self) -> u64
[src]
Get the current CRC value (it always returns a u64
value). You can continue calling digest
method even after getting a CRC value.
Get the current CRC value (it always returns a vec instance with a length corresponding to the CRC bits). You can continue calling digest
method even after getting a CRC value.
Get the current CRC value (it always returns a vec instance with a length corresponding to the CRC bits). You can continue calling digest
method even after getting a CRC value.
Check | Poly | Init | Ref | XorOut |
0x4 | 0x3 | 0x0 | false | 0x7 |
let mut crc = CRC::crc3gsm();
crc.digest(b"123456789");
assert_eq!("0x4", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x7 | 0x3 (rev: 0xC) | 0x0 | true | 0x0 |
let mut crc = CRC::crc4itu();
crc.digest(b"123456789");
assert_eq!("0x7", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xB | 0x3 | 0xF | false | 0xF |
let mut crc = CRC::crc4interlaken();
crc.digest(b"123456789");
assert_eq!("0xB", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x00 | 0x09 | 0x09 | false | 0x00 |
let mut crc = CRC::crc5epc();
crc.digest(b"123456789");
assert_eq!("0x00", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x07 | 0x15 (rev: 0x15) | 0x00 | true | 0x00 |
let mut crc = CRC::crc5itu();
crc.digest(b"123456789");
assert_eq!("0x07", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x19 | 0x05 (rev: 0x14) | 0x1F | true | 0x1F |
let mut crc = CRC::crc5usb();
crc.digest(b"123456789");
assert_eq!("0x19", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x0D | 0x27 | 0x3F | false | 0x00 |
let mut crc = CRC::crc6cdma2000_a();
crc.digest(b"123456789");
assert_eq!("0x0D", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x3B | 0x07 | 0x3F | false | 0x00 |
let mut crc = CRC::crc6cdma2000_b();
crc.digest(b"123456789");
assert_eq!("0x3B", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x26 | 0x19 (rev: 0x26) | 0x00 | true | 0x00 |
let mut crc = CRC::crc6darc();
crc.digest(b"123456789");
assert_eq!("0x26", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x13 | 0x2F | 0x00 | false | 0x3F |
let mut crc = CRC::crc6gsm();
crc.digest(b"123456789");
assert_eq!("0x13", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x06 | 0x03 (0x30) | 0x00 | true | 0x00 |
let mut crc = CRC::crc6itu();
crc.digest(b"123456789");
assert_eq!("0x06", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x75 | 0x09 | 0x00 | false | 0x00 |
let mut crc = CRC::crc7();
crc.digest(b"123456789");
assert_eq!("0x75", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x61 | 0x45 | 0x00 | false | 0x00 |
let mut crc = CRC::crc7umts();
crc.digest(b"123456789");
assert_eq!("0x61", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xF4 | 0x07 | 0x00 | false | 0x00 |
let mut crc = CRC::crc8();
crc.digest(b"123456789");
assert_eq!("0xF4", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xDA | 0x9B | 0xFF | false | 0x00 |
let mut crc = CRC::crc8cdma2000();
crc.digest(b"123456789");
assert_eq!("0xDA", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xDA | 0x39 (rev: 0x9C) | 0x00 | true | 0x00 |
let mut crc = CRC::crc8darc();
crc.digest(b"123456789");
assert_eq!("0x15", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xBC | 0xD5 | 0x00 | false | 0x00 |
let mut crc = CRC::crc8dvb_s2();
crc.digest(b"123456789");
assert_eq!("0xBC", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x97 | 0x1D (rev: 0xB8) | 0xFF | true | 0x00 |
let mut crc = CRC::crc8ebu();
crc.digest(b"123456789");
assert_eq!("0x97", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x7E | 0x1D | 0xFD | false | 0x00 |
let mut crc = CRC::crc8icode();
crc.digest(b"123456789");
assert_eq!("0x7E", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xA1 | 0x07 | 0x00 | false | 0x55 |
let mut crc = CRC::crc8itu();
crc.digest(b"123456789");
assert_eq!("0xA1", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xA1 | 0x31 (rev: 0x8C) | 0x00 | true | 0x00 |
let mut crc = CRC::crc8maxim();
crc.digest(b"123456789");
assert_eq!("0xA1", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xD0 | 0x07 (rev: 0xE0) | 0xFF | true | 0x00 |
let mut crc = CRC::crc8rohc();
crc.digest(b"123456789");
assert_eq!("0xD0", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x25 | 0x9B (rev: 0xD9) | 0x00 | true | 0x00 |
let mut crc = CRC::crc8wcdma();
crc.digest(b"123456789");
assert_eq!("0x25", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x199 | 0x233 | 0x000 | false | 0x000 |
let mut crc = CRC::crc10();
crc.digest(b"123456789");
assert_eq!("0x199", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x233 | 0x3D9 | 0x3FF | false | 0x000 |
let mut crc = CRC::crc10cdma2000();
crc.digest(b"123456789");
assert_eq!("0x233", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x12A | 0x175 | 0x000 | false | 0x3FF |
let mut crc = CRC::crc10gsm();
crc.digest(b"123456789");
assert_eq!("0x12A", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x5A3 | 0x385 | 0x01a | false | 0x000 |
let mut crc = CRC::crc11();
crc.digest(b"123456789");
assert_eq!("0x5A3", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xF5B | 0x080F | 0x0000 | false | 0x0000 |
let mut crc = CRC::crc12();
crc.digest(b"123456789");
assert_eq!("0xF5B", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xD4D | 0x0F13 | 0x0FFF | false | 0x0000 |
let mut crc = CRC::crc12cdma2000();
crc.digest(b"123456789");
assert_eq!("0xD4D", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xB34 | 0x0D31 | 0x0000 | false | 0x0FFF |
let mut crc = CRC::crc12gsm();
crc.digest(b"123456789");
assert_eq!("0xB34", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x04FA | 0x1CF5 | 0x0000 | false | 0x0000 |
let mut crc = CRC::crc13bbc();
crc.digest(b"123456789");
assert_eq!("0x04FA", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x082D | 0x0805 (rev: 0x2804) | 0x0000 | true | 0x0000 |
let mut crc = CRC::crc14darc();
crc.digest(b"123456789");
assert_eq!("0x082D", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x30AE | 0x202D | 0x0000 | false | 0x3FFF |
let mut crc = CRC::crc14gsm();
crc.digest(b"123456789");
assert_eq!("0x30AE", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x059E | 0x4599 | 0x0000 | false | 0x0000 |
let mut crc = CRC::crc15can();
crc.digest(b"123456789");
assert_eq!("0x059E", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x2566 | 0x6815 | 0x0000 | false | 0x0001 |
let mut crc = CRC::crc15mpt1327();
crc.digest(b"123456789");
assert_eq!("0x2566", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xBB3D | 0x8005 (rev: 0xA001) | 0x0000 | true | 0x0000 |
let mut crc = CRC::crc16();
crc.digest(b"123456789");
assert_eq!("0xBB3D", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x29B1 | 0x1021 | 0xFFFF | false | 0x0000 |
let mut crc = CRC::crc16ccitt_false();
crc.digest(b"123456789");
assert_eq!("0x29B1", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xE5CC | 0x1021 | 0x1D0F | false | 0x0000 |
let mut crc = CRC::crc16aug_ccitt();
crc.digest(b"123456789");
assert_eq!("0xE5CC", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xFEE8 | 0x8005 | 0x0000 | false | 0x0000 |
let mut crc = CRC::crc16buypass();
crc.digest(b"123456789");
assert_eq!("0xFEE8", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x4C06 | 0xC867 | 0xFFFF | false | 0x0000 |
let mut crc = CRC::crc16cdma2000();
crc.digest(b"123456789");
assert_eq!("0x4C06", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x9ECF | 0x8005 | 0x800D | false | 0x0000 |
let mut crc = CRC::crc16dds_110();
crc.digest(b"123456789");
assert_eq!("0x9ECF", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x007E | 0x0589 | 0x0000 | false | 0x0001 |
let mut crc = CRC::crc16dect_r();
crc.digest(b"123456789");
assert_eq!("0x007E", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x007F | 0x0589 | 0x0000 | false | 0x0000 |
let mut crc = CRC::crc16dect_r();
crc.digest(b"123456789");
assert_eq!("0x007E", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xEA82 | 0x3D65 (rev: 0xA6BC) | 0x0000 | true | 0xFFFF |
let mut crc = CRC::crc16dnp();
crc.digest(b"123456789");
assert_eq!("0xEA82", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xC2B7 | 0x3D65 | 0x0000 | false | 0xFFFF |
let mut crc = CRC::crc16en_13757();
crc.digest(b"123456789");
assert_eq!("0xC2B7", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xD64E | 0x1021 | 0xFFFF | false | 0xFFFF |
let mut crc = CRC::crc16genibus();
crc.digest(b"123456789");
assert_eq!("0xD64E", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x44C2 | 0x8005 (rev: 0xA001) | 0xFFFF | true | 0xFFFF |
let mut crc = CRC::crc16maxim();
crc.digest(b"123456789");
assert_eq!("0x44C2", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x6F91 | 0x1021 (rev: 0x8408) | 0xFFFF | true | 0x0000 |
let mut crc = CRC::crc16mcrf4cc();
crc.digest(b"123456789");
assert_eq!("0x6F91", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x63D0 | 0x1021 (rev: 0x8408) | 0xB2AA | true | 0x0000 |
let mut crc = CRC::crc16riello();
crc.digest(b"123456789");
assert_eq!("0x63D0", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xD0DB | 0x8BB7 | 0x0000 | false | 0x0000 |
let mut crc = CRC::crc16t10_dif();
crc.digest(b"123456789");
assert_eq!("0xD0DB", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x0FB3 | 0xA097 | 0x0000 | false | 0x0000 |
let mut crc = CRC::crc16teledisk();
crc.digest(b"123456789");
assert_eq!("0x0FB3", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x26B1 | 0x1021 (rev: 0x8408) | 0x89EC | true | 0x0000 |
let mut crc = CRC::crc16tms13157();
crc.digest(b"123456789");
assert_eq!("0x26B1", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xB4C8 | 0x8005 (rev: 0xA001) | 0xFFFF | true | 0xFFFF |
let mut crc = CRC::crc16usb();
crc.digest(b"123456789");
assert_eq!("0xB4C8", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xBF05 | 0x1021 (rev: 0x8408) | 0xC6C6 | true | 0x0000 |
let mut crc = CRC::crc_a();
crc.digest(b"123456789");
assert_eq!("0xBF05", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x2189 | 0x1021 (rev: 0x8408) | 0x0000 | true | 0x0000 |
let mut crc = CRC::crc16kermit();
crc.digest(b"123456789");
assert_eq!("0x2189", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x4B37 | 0x8005 (rev: 0xA001) | 0xFFFF | true | 0x0000 |
let mut crc = CRC::crc16modbus();
crc.digest(b"123456789");
assert_eq!("0x4B37", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x906E | 0x8005 (rev: 0xA001) | 0xFFFF | true | 0xFFFF |
let mut crc = CRC::crc16_x25();
crc.digest(b"123456789");
assert_eq!("0x906E", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x31C3 | 0x1021 | 0x0000 | false | 0x0000 |
let mut crc = CRC::crc16xmodem();
crc.digest(b"123456789");
assert_eq!("0x31C3", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x04F03 | 0x1685B | 0x00000 | false | 0x00000 |
let mut crc = CRC::crc17can();
crc.digest(b"123456789");
assert_eq!("0x04F03", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x0ED841 | 0x102899 | 0x000000 | false | 0x000000 |
let mut crc = CRC::crc21can();
crc.digest(b"123456789");
assert_eq!("0x0ED841", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x21CF02 | 0x864CFB | 0xB704CE | false | 0x000000 |
let mut crc = CRC::crc24();
crc.digest(b"123456789");
assert_eq!("0x21CF02", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xC25A56 | 0x00065B (rev: 0xDA6000) | 0x555555 | true | 0x000000 |
let mut crc = CRC::crc24ble();
crc.digest(b"123456789");
assert_eq!("0xC25A56", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x7979BD | 0x5D6DCB | 0xFEDCBA | false | 0x000000 |
let mut crc = CRC::crc24flexray_a();
crc.digest(b"123456789");
assert_eq!("0x7979BD", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x1F23B8 | 0x5D6DCB | 0xABCDEF | false | 0x000000 |
let mut crc = CRC::crc24flexray_b();
crc.digest(b"123456789");
assert_eq!("0x1F23B8", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xCDE703 | 0x864CFB | 0x000000 | false | 0x000000 |
let mut crc = CRC::crc24lte_a();
crc.digest(b"123456789");
assert_eq!("0xCDE703", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x23EF52 | 0x800063 | 0x000000 | false | 0x000000 |
let mut crc = CRC::crc24lte_b();
crc.digest(b"123456789");
assert_eq!("0x23EF52", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x200FA5 | 0x800063 | 0xFFFFFF | false | 0xFFFFFF |
let mut crc = CRC::crc24os9();
crc.digest(b"123456789");
assert_eq!("0x200FA5", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x04C34ABF | 0x2030B9C7 | 0x3FFFFFFF | false | 0x3FFFFFFF |
let mut crc = CRC::crc30cdma();
crc.digest(b"123456789");
assert_eq!("0x04C34ABF", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xCBF43926 | 0x04C11DB7 (rev: 0xEDB88320) | 0xFFFFFFFF | true | 0xFFFFFFFF |
let mut crc = CRC::crc32();
crc.digest(b"123456789");
assert_eq!("0xCBF43926", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x181989FC | 0x04C11DB7 | 0xFFFFFFFF | false | 0xFFFFFFFF |
Output will be reversed by bytes.
let mut crc = CRC::crc32mhash();
crc.digest(b"123456789");
assert_eq!("0x181989FC", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xFC891918 | 0x04C11DB7 | 0xFFFFFFFF | false | 0xFFFFFFFF |
let mut crc = CRC::crc32bzip2();
crc.digest(b"123456789");
assert_eq!("0xFC891918", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xE3069283 | 0x1EDC6F41 (rev: 0x82F63B78) | 0xFFFFFFFF | true | 0xFFFFFFFF |
let mut crc = CRC::crc32c();
crc.digest(b"123456789");
assert_eq!("0xE3069283", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x87315576 | 0xA833982B (rev: 0xD419CC15) | 0xFFFFFFFF | true | 0xFFFFFFFF |
let mut crc = CRC::crc32d();
crc.digest(b"123456789");
assert_eq!("0x87315576", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x0376E6E7 | 0x04C11DB7 | 0xFFFFFFFF | false | 0x00000000 |
let mut crc = CRC::crc32mpeg2();
crc.digest(b"123456789");
assert_eq!("0x0376E6E7", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x765E7680 | 0x04C11DB7 | 0x00000000 | false | 0xFFFFFFFF |
let mut crc = CRC::crc32posix();
crc.digest(b"123456789");
assert_eq!("0x765E7680", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x3010BF7F | 0x814141AB | 0x00000000 | false | 0x00000000 |
let mut crc = CRC::crc32q();
crc.digest(b"123456789");
assert_eq!("0x3010BF7F", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x340BC6D9 | 0x04C11DB7 (rev: 0xEDB88320) | 0x00000000 | true | 0x00000000 |
let mut crc = CRC::crc32jamcrc();
crc.digest(b"123456789");
assert_eq!("0x340BC6D9", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xBD0BE338 | 0x000000AF | 0x00000000 | false | 0x00000000 |
let mut crc = CRC::crc32xfer();
crc.digest(b"123456789");
assert_eq!("0xBD0BE338", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xD4164FC646 | 0x0004820009 | 0x0000000000 | false | 0xFFFFFFFFFF |
let mut crc = CRC::crc40gsm();
crc.digest(b"123456789");
assert_eq!("0xD4164FC646", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x6C40DF5F0B497347 | 0x42F0E1EBA9EA3693 | 0x0000000000000000 | false | 0x0000000000000000 |
let mut crc = CRC::crc64();
crc.digest(b"123456789");
assert_eq!("0x6C40DF5F0B497347", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xB90956C775A41001 | 0x000000000000001B (rev: 0xD800000000000000) | 0xFFFFFFFFFFFFFFFF | true | 0xFFFFFFFFFFFFFFFF |
let mut crc = CRC::crc64iso();
crc.digest(b"123456789");
assert_eq!("0xB90956C775A41001", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x62EC59E3F1A4F00A | 0x42F0E1EBA9EA3693 | 0xFFFFFFFFFFFFFFFF | false | 0xFFFFFFFFFFFFFFFF |
let mut crc = CRC::crc64we();
crc.digest(b"123456789");
assert_eq!("0x62EC59E3F1A4F00A", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xE9C6D914C4B8D9CA | 0xAD93D23594C935A9 (rev: 0x95AC9329AC4BC9B5) | 0x0000000000000000 | true | 0x0000000000000000 |
let mut crc = CRC::crc64jones();
crc.digest(b"123456789");
assert_eq!("0xE9C6D914C4B8D9CA", &crc.to_string());
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
[src]
Converts the given value to a String
. Read more
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.