pub struct Crc32Algorithm {
pub poly: u32,
pub init: u32,
pub refin: bool,
pub refout: bool,
pub xorout: u32,
pub check: u32,
/* private fields */
}Expand description
A CRC-32 variant (32-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: u32Generator polynomial (Rocksoft normal form, MSB-first).
init: u32Initial register value.
refin: boolReflect input bytes (LSB-first) if true.
refout: boolReflect the final register if true.
xorout: u32Value XORed into the final register.
check: u32CRC of b"123456789" — the self-check value (RevEng check).
Implementations§
Source§impl Crc32Algorithm
impl Crc32Algorithm
Sourcepub const fn new(
poly: u32,
init: u32,
refin: bool,
refout: bool,
xorout: u32,
check: u32,
) -> Self
pub const fn new( poly: u32, init: u32, refin: bool, refout: bool, xorout: u32, check: u32, ) -> 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 Crc32Algorithm
impl RefUnwindSafe for Crc32Algorithm
impl Send for Crc32Algorithm
impl Sync for Crc32Algorithm
impl Unpin for Crc32Algorithm
impl UnsafeUnpin for Crc32Algorithm
impl UnwindSafe for Crc32Algorithm
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