pub struct Crc { /* private fields */ }Expand description
A cyclic redundancy check of degree width and generator poly (without its
leading term), valid by construction (Crc::new checks them).
Implementations§
Source§impl Crc
impl Crc
Sourcepub fn new(name: &'static str, width: u32, poly: u64) -> Result<Crc>
pub fn new(name: &'static str, width: u32, poly: u64) -> Result<Crc>
A CRC of degree width (1 to 64) and generator poly without its leading term.
§Errors
Error::Config for a degree outside 1 to 64 or a generator with bits above it.
Sourcepub fn crc16() -> Crc
pub fn crc16() -> Crc
CRC16 of 5G NR and of LTE, $g_{\mathrm{CRC16}}(D) = D^{16} + D^{12} + D^{5} + 1$ (CCITT).
Sourcepub fn from_name(name: &str) -> Result<Crc>
pub fn from_name(name: &str) -> Result<Crc>
A CRC of 5G NR by name: crc24a, crc24b, crc24c, crc16, crc11 or crc6
(case-insensitive).
§Errors
Error::Config for another name.
Trait Implementations§
impl Eq for Crc
impl StructuralPartialEq for Crc
Auto Trait Implementations§
impl Forget for Crc
impl Freeze for Crc
impl RefUnwindSafe for Crc
impl Send for Crc
impl Sync for Crc
impl Unpin for Crc
impl UnsafeUnpin for Crc
impl UnwindSafe for Crc
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