[−][src]Struct crc_any::CRCu32
This struct can help you compute a CRC-32 (or CRC-x where x is equal or less than 32
) value.
Implementations
impl CRCu32
[src]
pub fn create_crc(
poly: u32,
bits: u8,
initial: u32,
final_xor: u32,
reflect: bool
) -> CRCu32
[src]
poly: u32,
bits: u8,
initial: u32,
final_xor: u32,
reflect: bool
) -> CRCu32
Create a CRCu32
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]
Digest some data.
pub fn reset(&mut self)
[src]
Reset the sum.
pub fn get_crc(&self) -> u32
[src]
Get the current CRC value (it always returns a u32
value). You can continue calling digest
method even after getting a CRC value.
impl CRCu32
[src]
pub fn get_crc_vec_le(&mut self) -> Vec<u8>
[src]
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.
pub fn get_crc_vec_be(&mut self) -> Vec<u8>
[src]
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.
impl CRCu32
[src]
pub fn crc17can() -> CRCu32
[src]
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());
pub fn crc21can() -> CRCu32
[src]
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());
pub fn crc24() -> CRCu32
[src]
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());
pub fn crc24ble() -> CRCu32
[src]
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());
pub fn crc24flexray_a() -> CRCu32
[src]
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());
pub fn crc24flexray_b() -> CRCu32
[src]
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());
pub fn crc24lte_a() -> CRCu32
[src]
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());
pub fn crc24lte_b() -> CRCu32
[src]
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());
pub fn crc24os9() -> CRCu32
[src]
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());
pub fn crc30cdma() -> CRCu32
[src]
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());
pub fn crc32() -> CRCu32
[src]
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());
pub fn crc32mhash() -> CRCu32
[src]
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());
pub fn crc32bzip2() -> CRCu32
[src]
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());
pub fn crc32c() -> CRCu32
[src]
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());
pub fn crc32d() -> CRCu32
[src]
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());
pub fn crc32mpeg2() -> CRCu32
[src]
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());
pub fn crc32posix() -> CRCu32
[src]
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());
pub fn crc32q() -> CRCu32
[src]
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());
pub fn crc32jamcrc() -> CRCu32
[src]
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());
pub fn crc32xfer() -> CRCu32
[src]
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());
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,