malachite-base 0.4.6

A collection of utilities, including new arithmetic traits and iterators that generate all values of a type
Documentation
1
2
3
4
5
6
7
8
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};

pub fn hash<T: Hash>(n: &T) -> u64 {
    let mut s = DefaultHasher::new();
    n.hash(&mut s);
    s.finish()
}