5 unstable releases

Uses old Rust 2015

0.3.1 Mar 3, 2016
0.3.0 Jan 27, 2016
0.2.0 May 9, 2015
0.1.1 Nov 22, 2014
0.1.0 Nov 20, 2014

#2138 in Data structures

Download history 34/week @ 2024-04-08 42/week @ 2024-04-15 39/week @ 2024-04-22 21/week @ 2024-04-29 24/week @ 2024-05-06 18/week @ 2024-05-13 42/week @ 2024-05-20 80/week @ 2024-05-27 45/week @ 2024-06-03 23/week @ 2024-06-10 25/week @ 2024-06-17 33/week @ 2024-06-24 29/week @ 2024-07-01 11/week @ 2024-07-08 36/week @ 2024-07-15 40/week @ 2024-07-22

119 downloads per month
Used in 5 crates (3 directly)

BSD-3-Clause

9KB
152 lines

MurmurHash2 (64bit) implementation

Build Status

Based on the implementation for Redis (antirez/redis src/hyperloglog.c)

More info and different implementations available at: https://sites.google.com/site/murmurhash/

Documentation

Build

cargo build --release

Usage

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"));
}

Tests

Run tests with:

cargo test

Contribute

If you find bugs or want to help otherwise, please open an issue.

License

BSD. See LICENSE.

Dependencies

~330–560KB