Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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
5 changes: 4 additions & 1 deletion src/xxhash3_128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down
Loading