[][src]Struct crc::crc64::Digest

pub struct Digest { /* fields omitted */ }

Digest struct for CRC calculation

  • table: Calculation table generated from input parameters.
  • initial: Initial value.
  • value: Current value of the CRC calculation.
  • final_xor: Final value to XOR with when calling Digest::sum64().
  • calc: Type of calculation. See its documentation for details.

Methods

impl Digest[src]

pub fn new(poly: u64) -> Digest[src]

Creates a new Digest from input polynomial.

Example

use crc::{crc64, Hasher64};
let mut digest = crc64::Digest::new(crc64::ECMA);
digest.write(b"123456789");
assert_eq!(digest.sum64(), 0x995dc9bbdf1939fa);;

pub fn new_with_initial(poly: u64, initial: u64) -> Digest[src]

Creates a new Digest from input polynomial and initial value.

Example

use crc::{crc64, Hasher64};
let mut digest = crc64::Digest::new_with_initial(crc64::ECMA, 0u64);
digest.write(b"123456789");
assert_eq!(digest.sum64(), 0x995dc9bbdf1939fa);

pub fn new_custom(
    poly: u64,
    initial: u64,
    final_xor: u64,
    calc: CalcType
) -> Digest
[src]

Creates a fully customized Digest from input parameters.

Example

use crc::{crc64, Hasher64};
let mut digest = crc64::Digest::new_custom(crc64::ECMA, !0u64, !0u64, crc::CalcType::Reverse);
digest.write(b"123456789");
assert_eq!(digest.sum64(), 0x995dc9bbdf1939fa);

Trait Implementations

impl Hasher64 for Digest[src]

impl Hasher for Digest[src]

Auto Trait Implementations

impl Send for Digest

impl Sync for Digest

impl Unpin for Digest

impl UnwindSafe for Digest

impl RefUnwindSafe for Digest

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]