diff --git a/README.md b/README.md index 6939cf498..a382a440b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ A Rust implementation of the [xxHash] algorithm. # Examples These examples use [`XxHash64`][] but the same ideas can be -used for [`XxHash32`][] or [`XxHash3_64`][]. +used for [`XxHash32`][], [`XxHash3_64`][], or [`XxHash3_128`][]. ## Hashing arbitrary data @@ -82,15 +82,16 @@ assert_eq!(hash.get(&42), Some(&"the answer")); # Feature Flags -| name | description | -|------------|---------------------------------------------------------------------------------------------------------| -| xxhash32 | Include the [`XxHash32`][] algorithm | -| xxhash64 | Include the [`XxHash64`][] algorithm | -| xxhash3_64 | Include the [`XxHash3_64`][] algorithm | -| random | Create random instances of the hashers | -| serialize | Serialize and deserialize hasher state with Serde | -| std | Use the Rust standard library. Enable this if you want SIMD support in [`XxHash3_64`][] | -| alloc | Use the Rust allocator library. Enable this if you want to create [`XxHash3_64`][] with dynamic secrets | +| name | description | +|-------------|-------------------------------------------------------------------------------------------------------------------------------| +| xxhash32 | Include the [`XxHash32`][] algorithm | +| xxhash64 | Include the [`XxHash64`][] algorithm | +| xxhash3_64 | Include the [`XxHash3_64`][] algorithm | +| xxhash3_128 | Include the [`XxHash3_128`][] algorithm | +| random | Create random instances of the hashers | +| serialize | Serialize and deserialize hasher state with Serde | +| std | Use the Rust standard library. Enable this if you want SIMD support in [`XxHash3_64`][] or [`XxHash3_128`][] | +| alloc | Use the Rust allocator library. Enable this if you want to create [`XxHash3_64`][] or [`XxHash3_128`][] with dynamic secrets | # Benchmarks @@ -114,3 +115,4 @@ See benchmarks in the [comparison][] README. [`XxHash32`]: crate::XxHash32 [`XxHash64`]: crate::XxHash64 [`XxHash3_64`]: crate::XxHash3_64 +[`XxHash3_128`]: crate::XxHash3_128 diff --git a/src/xxhash3_128.rs b/src/xxhash3_128.rs index d7624378c..54da573e5 100644 --- a/src/xxhash3_128.rs +++ b/src/xxhash3_128.rs @@ -17,8 +17,10 @@ pub use crate::xxhash3::{ }; /// Calculates the 128-bit hash. +/// +/// This type does not implement [`std::hash::Hasher`] as that trait +/// requires a 64-bit result while this computes a 128-bit result. #[derive(Clone)] -/// TODO: does not implement hash. pub struct Hasher { #[cfg(feature = "alloc")] inner: AllocRawHasher, @@ -83,6 +85,7 @@ impl Hasher { Ok(impl_oneshot(secret, seed, input)) } } + #[cfg(feature = "alloc")] #[cfg_attr(docsrs, doc(cfg(feature = "alloc")))] mod with_alloc {