Crates.io | murmurhash64 |
lib.rs | murmurhash64 |
version | 0.3.1 |
source | src |
created_at | 2014-11-20 20:46:11.482684 |
updated_at | 2016-03-03 21:47:33.446956 |
description | Implementation of MurmurHash2 (64bit version) |
homepage | https://github.com/badboy/murmurhash64-rs |
repository | https://github.com/badboy/murmurhash64-rs |
max_upload_size | |
id | 146 |
size | 12,917 |
Based on the implementation for Redis (antirez/redis src/hyperloglog.c)
More info and different implementations available at: https://sites.google.com/site/murmurhash/
cargo build --release
use murmurhash64::murmur_hash64a;
fn main() {
let key = "Pizza & Mandolino";
let seed = 2915580697;
let hash = murmur_hash64a(key.as_bytes(), seed);
}
As a Hasher
use std::collections::HashMap;
use murmurhash64::{MurmurHasher,RandomMurmurState};
use std::default::Default;
fn main() {
let mut hashmap : HashMap<_, _, RandomMurmurState> = Default::default();
hashmap.insert("abc", 123);
hashmap.insert("def", 456);
assert_eq!(Some(&123), hashmap.get("abc"));
assert_eq!(Some(&456), hashmap.get("def"));
}
Run tests with:
cargo test
If you find bugs or want to help otherwise, please open an issue.
BSD. See LICENSE.