raphtory_api/core/utils/
hashing.rs

1
2
3
4
5
6
7
8
9
10
//! Utility functions used throughout the modules.

use std::hash::{Hash, Hasher};
use twox_hash::XxHash64;

pub fn calculate_hash<T: Hash + ?Sized>(t: &T) -> u64 {
    let mut s = XxHash64::default();
    t.hash(&mut s);
    s.finish()
}