Struct rendezvous_hash::DefaultNodeHasher [] [src]

pub struct DefaultNodeHasher(_);

The default NodeHasher implementation.

This uses SipHasher13 to hash nodes and items. SipHasher13 is provided by siphash crate.

To hash a combination of a node and an item, DefaultNodeHasher hashes the item at first, then hashes the node, and finally returns the resulting hash value (as follows).

use siphasher::sip::SipHasher13;
let mut hasher = SipHasher13::new();
item.hash(&mut hasher);
node.hash(&mut hasher);
hasher.finish()

Methods

impl DefaultNodeHasher
[src]

Makes a new DefaultNodeHasher instance.

Trait Implementations

impl Debug for DefaultNodeHasher
[src]

Formats the value using the given formatter.

impl Clone for DefaultNodeHasher
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<N: Hash> NodeHasher<N> for DefaultNodeHasher
[src]

Returns the hash value for the combination of node and item.