Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/badboy/murmurhash64-rs
MurmurHash2 (64bit version) implementation
https://github.com/badboy/murmurhash64-rs
Last synced: 9 days ago
JSON representation
MurmurHash2 (64bit version) implementation
- Host: GitHub
- URL: https://github.com/badboy/murmurhash64-rs
- Owner: badboy
- License: bsd-3-clause
- Created: 2014-10-28T15:45:31.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-07-18T12:14:52.000Z (over 3 years ago)
- Last Synced: 2024-12-24T02:01:30.199Z (12 days ago)
- Language: Rust
- Homepage: http://badboy.github.io/murmurhash64-rs/murmurhash64/
- Size: 5.01 MB
- Stars: 4
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# MurmurHash2 (64bit) implementation
[![Build Status](https://travis-ci.org/badboy/murmurhash64-rs.svg?branch=master)](https://travis-ci.org/badboy/murmurhash64-rs)
[![crates.io](http://meritbadge.herokuapp.com/murmurhash64)](https://crates.io/crates/murmurhash64)Based on the implementation for Redis
([antirez/redis src/hyperloglog.c](https://github.com/antirez/redis/blob/93eed9ae0163e328c33b16ab9ea3c4fbe0f98674/src/hyperloglog.c#L390-L439))More info and different implementations available at:
[Documentation](http://badboy.github.io/murmurhash64-rs/murmurhash64/)
## Build
```
cargo build --release
```## Usage
```rust
use murmurhash64::murmur_hash64a;fn main() {
let key = "Pizza & Mandolino";
let seed = 2915580697;let hash = murmur_hash64a(key.as_bytes(), seed);
}```
As a `Hasher`
```rust
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](https://github.com/badboy/murmurhash64-rs/issues).
## License
BSD. See [LICENSE](LICENSE).