pub struct CRCu32 { /* private fields */ }
Expand description
This struct can help you compute a CRC-32 (or CRC-x where x is equal or less than 32
) value.
Implementations§
source§impl CRCu32
impl CRCu32
source§impl CRCu32
impl CRCu32
sourcepub fn get_crc_vec_le(&mut self) -> Vec<u8>
pub fn get_crc_vec_le(&mut self) -> Vec<u8>
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.
sourcepub fn get_crc_vec_be(&mut self) -> Vec<u8>
pub fn get_crc_vec_be(&mut self) -> Vec<u8>
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.
source§impl CRCu32
impl CRCu32
sourcepub fn crc17can() -> CRCu32
pub fn crc17can() -> CRCu32
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());
sourcepub fn crc21can() -> CRCu32
pub fn crc21can() -> CRCu32
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());
sourcepub fn crc24() -> CRCu32
pub fn crc24() -> CRCu32
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());
sourcepub fn crc24ble() -> CRCu32
pub fn crc24ble() -> CRCu32
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());
sourcepub fn crc24flexray_a() -> CRCu32
pub fn crc24flexray_a() -> CRCu32
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());
sourcepub fn crc24flexray_b() -> CRCu32
pub fn crc24flexray_b() -> CRCu32
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());
sourcepub fn crc24lte_a() -> CRCu32
pub fn crc24lte_a() -> CRCu32
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());
sourcepub fn crc24lte_b() -> CRCu32
pub fn crc24lte_b() -> CRCu32
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());
sourcepub fn crc24os9() -> CRCu32
pub fn crc24os9() -> CRCu32
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());
sourcepub fn crc30cdma() -> CRCu32
pub fn crc30cdma() -> CRCu32
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());
sourcepub fn crc32() -> CRCu32
pub fn crc32() -> CRCu32
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());
sourcepub fn crc32mhash() -> CRCu32
pub fn crc32mhash() -> CRCu32
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());
sourcepub fn crc32bzip2() -> CRCu32
pub fn crc32bzip2() -> CRCu32
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());
sourcepub fn crc32c() -> CRCu32
pub fn crc32c() -> CRCu32
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());
sourcepub fn crc32d() -> CRCu32
pub fn crc32d() -> CRCu32
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());
sourcepub fn crc32mpeg2() -> CRCu32
pub fn crc32mpeg2() -> CRCu32
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());
sourcepub fn crc32posix() -> CRCu32
pub fn crc32posix() -> CRCu32
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());
sourcepub fn crc32q() -> CRCu32
pub fn crc32q() -> CRCu32
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());
sourcepub fn crc32jamcrc() -> CRCu32
pub fn crc32jamcrc() -> CRCu32
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());
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CRCu32
impl RefUnwindSafe for CRCu32
impl Send for CRCu32
impl Sync for CRCu32
impl Unpin for CRCu32
impl UnwindSafe for CRCu32
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more