Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change of Hasher #12

Closed
PlaneB opened this issue Jan 31, 2019 · 2 comments
Closed

Change of Hasher #12

PlaneB opened this issue Jan 31, 2019 · 2 comments

Comments

@PlaneB
Copy link

PlaneB commented Jan 31, 2019

Is it possible to change the hasher for key generation? For example in my case it makes sense to use https://crates.rs/crates/nohash-hasher as keys are already hash values.

@novacrazy
Copy link
Collaborator

You can use Options like so:

extern crate evmap;
extern crate nohash_hasher;

use nohash_hasher::BuildNoHashHasher;

/// whatever your key type is
type K = i32;

/// whatever your value type is
type V = i32;

fn main() {
    let (r, mut w) = evmap::Options::default()
        .with_hasher(BuildNoHashHasher::<K>::default())
        .construct::<K, V>();

    // ...
}

or use evmap::with_hasher

@PlaneB
Copy link
Author

PlaneB commented Jan 31, 2019

Thanks. Nice crate by the way

jonhoo pushed a commit that referenced this issue Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants