pub struct CRCu32 { /* fields omitted */ }
Expand description
This struct can help you compute a CRC-32 (or CRC-x where x is equal or less than 32
) value.
Create a CRCu32
instance by providing the length of bits, expression, reflection, an initial value and a final xor value.
Get the current CRC value (it always returns a u32
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 |
0x04F03 | 0x1685B | 0x00000 | false | 0x00000 |
let mut crc = CRCu32::crc17can();
crc.digest(b"123456789");
assert_eq!("0x04F03", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x0ED841 | 0x102899 | 0x000000 | false | 0x000000 |
let mut crc = CRCu32::crc21can();
crc.digest(b"123456789");
assert_eq!("0x0ED841", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x21CF02 | 0x864CFB | 0xB704CE | false | 0x000000 |
let mut crc = CRCu32::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 = CRCu32::crc24ble();
crc.digest(b"123456789");
assert_eq!("0xC25A56", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x7979BD | 0x5D6DCB | 0xFEDCBA | false | 0x000000 |
let mut crc = CRCu32::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 = CRCu32::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 = CRCu32::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 = CRCu32::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 = CRCu32::crc24os9();
crc.digest(b"123456789");
assert_eq!("0x200FA5", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x04C34ABF | 0x2030B9C7 | 0x3FFFFFFF | false | 0x3FFFFFFF |
let mut crc = CRCu32::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 = CRCu32::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 = CRCu32::crc32mhash();
crc.digest(b"123456789");
assert_eq!("0x181989FC", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xFC891918 | 0x04C11DB7 | 0xFFFFFFFF | false | 0xFFFFFFFF |
let mut crc = CRCu32::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 = CRCu32::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 = CRCu32::crc32d();
crc.digest(b"123456789");
assert_eq!("0x87315576", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x0376E6E7 | 0x04C11DB7 | 0xFFFFFFFF | false | 0x00000000 |
let mut crc = CRCu32::crc32mpeg2();
crc.digest(b"123456789");
assert_eq!("0x0376E6E7", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x765E7680 | 0x04C11DB7 | 0x00000000 | false | 0xFFFFFFFF |
let mut crc = CRCu32::crc32posix();
crc.digest(b"123456789");
assert_eq!("0x765E7680", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x3010BF7F | 0x814141AB | 0x00000000 | false | 0x00000000 |
let mut crc = CRCu32::crc32q();
crc.digest(b"123456789");
assert_eq!("0x3010BF7F", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x340BC6D9 | 0x04C11DB7 (rev: 0xEDB88320) | 0xFFFFFFFF | true | 0x00000000 |
let mut crc = CRCu32::crc32jamcrc();
crc.digest(b"123456789");
assert_eq!("0x340BC6D9", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xBD0BE338 | 0x000000AF | 0x00000000 | false | 0x00000000 |
let mut crc = CRCu32::crc32xfer();
crc.digest(b"123456789");
assert_eq!("0xBD0BE338", &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,
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>,
Converts the given value to a String
. Read more
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.