pub struct Crc16Algorithm {
pub poly: u16,
pub init: u16,
pub refin: bool,
pub refout: bool,
pub xorout: u16,
pub check: u16,
/* private fields */
}Expand description
A CRC-16 variant (16-bit generator, Rocksoft parameters).
Build a custom variant with new; the named pub const
definitions in this module cover the usual sets. Not cryptographic —
see the module docs.
Fields§
§poly: u16Generator polynomial (Rocksoft normal form, MSB-first).
init: u16Initial register value.
refin: boolReflect input bytes (LSB-first) if true.
refout: boolReflect the final register if true.
xorout: u16Value XORed into the final register.
check: u16CRC of b"123456789" — the self-check value (RevEng check).
Implementations§
Source§impl Crc16Algorithm
impl Crc16Algorithm
Sourcepub const fn new(
poly: u16,
init: u16,
refin: bool,
refout: bool,
xorout: u16,
check: u16,
) -> Self
pub const fn new( poly: u16, init: u16, refin: bool, refout: bool, xorout: u16, check: u16, ) -> Self
Define a CRC variant from its Rocksoft parameters. const, so the
256-entry table is generated at compile time.
poly/init/refin/refout/xorout: model params.check: the expected CRC ofb"123456789"(asserted in tests).
Auto Trait Implementations§
impl Freeze for Crc16Algorithm
impl RefUnwindSafe for Crc16Algorithm
impl Send for Crc16Algorithm
impl Sync for Crc16Algorithm
impl Unpin for Crc16Algorithm
impl UnsafeUnpin for Crc16Algorithm
impl UnwindSafe for Crc16Algorithm
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