diff --git a/Cargo.toml b/Cargo.toml index dbbeb2d..db37da5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fnv" -version = "1.0.3" +version = "1.0.4" authors = ["Alex Crichton "] description = "Fowler–Noll–Vo hash function" license = "Apache-2.0 / MIT" diff --git a/lib.rs b/lib.rs index e42abc7..b191f23 100644 --- a/lib.rs +++ b/lib.rs @@ -78,8 +78,16 @@ impl Default for FnvHasher { } } -impl Hasher for FnvHasher { +impl FnvHasher { + /// Create an FNV hasher starting with a state corresponding + /// to the hash `key`. + #[inline] + pub fn with_key(key: u64) -> FnvHasher { + FnvHasher(key) + } +} +impl Hasher for FnvHasher { #[inline] fn finish(&self) -> u64 { self.0