dbsp 0.287.0

Continuous streaming analytics engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Hashing utilities.

use std::hash::{Hash, Hasher};
use xxhash_rust::xxh3::Xxh3Default;

/// Default hashing function used to shard records across workers.
pub fn default_hash<T: Hash + ?Sized>(x: &T) -> u64 {
    let mut hasher = Xxh3Default::new();
    x.hash(&mut hasher);
    hasher.finish()
}

pub fn default_hasher() -> impl Hasher {
    Xxh3Default::new()
}