Skip to content

Commit

Permalink
Add details on when to use Xxh3Default
Browse files Browse the repository at this point in the history
  • Loading branch information
DoumanAsh committed Oct 15, 2024
1 parent 29ab4d1 commit b106e4d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/xxh3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,8 @@ fn xxh3_stateful_digest_internal(acc: &mut Acc, nb_stripes_acc: usize, buffer: &
///Default XXH3 Streaming algorithm
///
///This is optimized version of Xxh3 struct that uses default seed/secret
///
///Optimal for use in hash maps
pub struct Xxh3Default {
acc: Acc,
buffer: Aligned64<[mem::MaybeUninit<u8>; INTERNAL_BUFFER_SIZE]>,
Expand Down Expand Up @@ -985,6 +987,9 @@ impl std::io::Write for Xxh3Default {
///Internal state uses rather large buffers, therefore it might be beneficial
///to store hasher on heap rather than stack.
///Implementation makes no attempts at that, leaving choice entirely to user.
///
///Note that it is better to use [Xxh3Default](struct.Xxh3Default.html) in hash maps
///due to Rust hash interface which requires to create new instance of hasher every time.
pub struct Xxh3 {
acc: Acc,
custom_secret: Aligned64<[u8; DEFAULT_SECRET_SIZE]>,
Expand Down

0 comments on commit b106e4d

Please sign in to comment.