Struct fnv_rs::Fnv128

source ·
pub struct Fnv128(_);
Expand description

A FNV-1a hasher that produces a 128-bit output.

Examples:

let mut hasher = Fnv128::new();
hasher.update(bytes);
hasher.finalize();

OR

let hash = Fnv128::hash(bytes);

Trait Implementations§

source§

impl Debug for Fnv128

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Fnv128

source§

fn default() -> Fnv128

Returns the “default value” for a type. Read more
source§

impl FnvHasher for Fnv128

source§

fn new() -> Self

Creates a new default Fnv128 object.

Example:
let hasher = Fnv128::new();
source§

fn update(&mut self, bytes: &[u8])

Incrementally update the Fnv128 object.

This method is best used when you need to update the hasher multiple times. If you only need to hash a single piece of data, consider using the hash method instead.

Example:
hasher.update(bytes);
source§

fn finalize(&self) -> FnvHashResult

Finalize the Fnv128 object.

Example:
hasher.finalize();
source§

fn hash<T: AsRef<[u8]>>(bytes: T) -> FnvHashResult

One-time use of the Fnv128 object.

Using this method is shorthand for the following:

let mut hasher = Fnv128::new();
hasher.update(bytes);
hasher.finalize();
Example:
let hash = Fnv128::hash(bytes);

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.