pub struct CRCu16 { /* private fields */ }
Expand description
This struct can help you compute a CRC-16 (or CRC-x where x is equal or less than 16
) value.
Create a CRCu16
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 u16
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 |
0x199 | 0x233 | 0x000 | false | 0x000 |
let mut crc = CRCu16::crc10();
crc.digest(b"123456789");
assert_eq!("0x199", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x233 | 0x3D9 | 0x3FF | false | 0x000 |
let mut crc = CRCu16::crc10cdma2000();
crc.digest(b"123456789");
assert_eq!("0x233", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x12A | 0x175 | 0x000 | false | 0x3FF |
let mut crc = CRCu16::crc10gsm();
crc.digest(b"123456789");
assert_eq!("0x12A", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x5A3 | 0x385 | 0x01a | false | 0x000 |
let mut crc = CRCu16::crc11();
crc.digest(b"123456789");
assert_eq!("0x5A3", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xF5B | 0x80F | 0x000 | false | 0x000 |
let mut crc = CRCu16::crc12();
crc.digest(b"123456789");
assert_eq!("0xF5B", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xD4D | 0xF13 | 0xFFF | false | 0x000 |
let mut crc = CRCu16::crc12cdma2000();
crc.digest(b"123456789");
assert_eq!("0xD4D", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xB34 | 0xD31 | 0x000 | false | 0xFFF |
let mut crc = CRCu16::crc12gsm();
crc.digest(b"123456789");
assert_eq!("0xB34", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x04FA | 0x1CF5 | 0x0000 | false | 0x0000 |
let mut crc = CRCu16::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 = CRCu16::crc14darc();
crc.digest(b"123456789");
assert_eq!("0x082D", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x30AE | 0x202D | 0x0000 | false | 0x3FFF |
let mut crc = CRCu16::crc14gsm();
crc.digest(b"123456789");
assert_eq!("0x30AE", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x059E | 0x4599 | 0x0000 | false | 0x0000 |
let mut crc = CRCu16::crc15can();
crc.digest(b"123456789");
assert_eq!("0x059E", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x2566 | 0x6815 | 0x0000 | false | 0x0001 |
let mut crc = CRCu16::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 = CRCu16::crc16();
crc.digest(b"123456789");
assert_eq!("0xBB3D", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x29B1 | 0x1021 | 0xFFFF | false | 0x0000 |
let mut crc = CRCu16::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 = CRCu16::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 = CRCu16::crc16buypass();
crc.digest(b"123456789");
assert_eq!("0xFEE8", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x4C06 | 0xC867 | 0xFFFF | false | 0x0000 |
let mut crc = CRCu16::crc16cdma2000();
crc.digest(b"123456789");
assert_eq!("0x4C06", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0x9ECF | 0x8005 | 0x800D | false | 0x0000 |
let mut crc = CRCu16::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 = CRCu16::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 = CRCu16::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 = CRCu16::crc16dnp();
crc.digest(b"123456789");
assert_eq!("0xEA82", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xC2B7 | 0x3D65 | 0x0000 | false | 0xFFFF |
let mut crc = CRCu16::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 = CRCu16::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 = CRCu16::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 = CRCu16::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 = CRCu16::crc16riello();
crc.digest(b"123456789");
assert_eq!("0x63D0", &crc.to_string());
Check | Poly | Init | Ref | XorOut |
0xD0DB | 0x8BB7 | 0x0000 | false | 0x0000 |
let mut crc = CRCu16::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 = CRCu16::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 = CRCu16::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 = CRCu16::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 = CRCu16::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 = CRCu16::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 = CRCu16::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 = CRCu16::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 = CRCu16::crc16xmodem();
crc.digest(b"123456789");
assert_eq!("0x31C3", &crc.to_string());
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
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.