pub struct CRCu8 { /* private fields */ }
Expand description
This struct can help you compute a CRC-8 (or CRC-x where x is equal or less than 8
) value.
Implementations§
source§impl CRCu8
impl CRCu8
source§impl CRCu8
impl CRCu8
sourcepub fn crc3gsm() -> CRCu8
pub fn crc3gsm() -> CRCu8
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());
sourcepub fn crc4itu() -> CRCu8
pub fn crc4itu() -> CRCu8
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());
sourcepub fn crc4interlaken() -> CRCu8
pub fn crc4interlaken() -> CRCu8
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());
sourcepub fn crc5epc() -> CRCu8
pub fn crc5epc() -> CRCu8
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());
sourcepub fn crc5itu() -> CRCu8
pub fn crc5itu() -> CRCu8
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());
sourcepub fn crc5usb() -> CRCu8
pub fn crc5usb() -> CRCu8
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());
sourcepub fn crc6cdma2000_a() -> CRCu8
pub fn crc6cdma2000_a() -> CRCu8
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());
sourcepub fn crc6cdma2000_b() -> CRCu8
pub fn crc6cdma2000_b() -> CRCu8
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());
sourcepub fn crc6darc() -> CRCu8
pub fn crc6darc() -> CRCu8
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());
sourcepub fn crc6gsm() -> CRCu8
pub fn crc6gsm() -> CRCu8
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());
sourcepub fn crc6itu() -> CRCu8
pub fn crc6itu() -> CRCu8
Check | Poly | Init | Ref | XorOut |
---|---|---|---|---|
0x06 | 0x03 (rev: 0x30) | 0x00 | true | 0x00 |
let mut crc = CRCu8::crc6itu();
crc.digest(b"123456789");
assert_eq!("0x06", &crc.to_string());
sourcepub fn crc7() -> CRCu8
pub fn crc7() -> CRCu8
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());
sourcepub fn crc7umts() -> CRCu8
pub fn crc7umts() -> CRCu8
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());
sourcepub fn crc8() -> CRCu8
pub fn crc8() -> CRCu8
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());
sourcepub fn crc8cdma2000() -> CRCu8
pub fn crc8cdma2000() -> CRCu8
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());
sourcepub fn crc8darc() -> CRCu8
pub fn crc8darc() -> CRCu8
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());
sourcepub fn crc8dvb_s2() -> CRCu8
pub fn crc8dvb_s2() -> CRCu8
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());
sourcepub fn crc8ebu() -> CRCu8
pub fn crc8ebu() -> CRCu8
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());
sourcepub fn crc8icode() -> CRCu8
pub fn crc8icode() -> CRCu8
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());
sourcepub fn crc8itu() -> CRCu8
pub fn crc8itu() -> CRCu8
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());
sourcepub fn crc8maxim() -> CRCu8
pub fn crc8maxim() -> CRCu8
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());
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CRCu8
impl RefUnwindSafe for CRCu8
impl Send for CRCu8
impl Sync for CRCu8
impl Unpin for CRCu8
impl UnwindSafe for CRCu8
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