pub struct CRCu8 { /* fields omitted */ }
This struct can help you compute a CRC-8 (or CRC-x where x is equal or less than 8
) value.
pub fn create_crc(
poly: u8,
bits: u8,
initial: u8,
final_xor: u8,
reflect: bool
) -> CRCu8
[src]
Create a CRCu8
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]
Get the current CRC value (it always returns a u8
value). 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 = CRCu8::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 = CRCu8::crc4itu();
crc.digest(b"123456789");
assert_eq!("0x7", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xB | 0x3 | 0xF | false | 0xF |
let mut crc = CRCu8::crc4interlaken();
crc.digest(b"123456789");
assert_eq!("0xB", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x00 | 0x09 | 0x09 | false | 0x00 |
let mut crc = CRCu8::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 = CRCu8::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 = CRCu8::crc5usb();
crc.digest(b"123456789");
assert_eq!("0x19", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x0D | 0x27 | 0x3F | false | 0x00 |
let mut crc = CRCu8::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 = CRCu8::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 = CRCu8::crc6darc();
crc.digest(b"123456789");
assert_eq!("0x26", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x13 | 0x2F | 0x00 | false | 0x3F |
let mut crc = CRCu8::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 = CRCu8::crc6itu();
crc.digest(b"123456789");
assert_eq!("0x06", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x75 | 0x09 | 0x00 | false | 0x00 |
let mut crc = CRCu8::crc7();
crc.digest(b"123456789");
assert_eq!("0x75", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x61 | 0x45 | 0x00 | false | 0x00 |
let mut crc = CRCu8::crc7umts();
crc.digest(b"123456789");
assert_eq!("0x61", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xF4 | 0x07 | 0x00 | false | 0x00 |
let mut crc = CRCu8::crc8();
crc.digest(b"123456789");
assert_eq!("0xF4", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xDA | 0x9B | 0xFF | false | 0x00 |
let mut crc = CRCu8::crc8cdma2000();
crc.digest(b"123456789");
assert_eq!("0xDA", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x15 | 0x39 (rev: 0x9C) | 0x00 | true | 0x00 |
let mut crc = CRCu8::crc8darc();
crc.digest(b"123456789");
assert_eq!("0x15", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xBC | 0xD5 | 0x00 | false | 0x00 |
let mut crc = CRCu8::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 = CRCu8::crc8ebu();
crc.digest(b"123456789");
assert_eq!("0x97", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x7E | 0x1D | 0xFD | false | 0x00 |
let mut crc = CRCu8::crc8icode();
crc.digest(b"123456789");
assert_eq!("0x7E", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xA1 | 0x07 | 0x00 | false | 0x55 |
let mut crc = CRCu8::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 = CRCu8::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 = CRCu8::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 = CRCu8::crc8wcdma();
crc.digest(b"123456789");
assert_eq!("0x25", &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.