Skip to content

Commit

Permalink
Derive Clone for Xxh32/64
Browse files Browse the repository at this point in the history
In some obscure cases, like implementing Digest traits for non-cryptographical hashes, I could really use the `Clone` implementation to keep things simpler.

See https://github.com/nyurik/noncrypto-digests
  • Loading branch information
nyurik authored and DoumanAsh committed Dec 20, 2023
1 parent 11ade8a commit 3700b45
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/xxh32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ pub fn xxh32(mut input: &[u8], seed: u32) -> u32 {
}

///XXH32 Streaming algorithm
#[derive(Clone)]
pub struct Xxh32 {
total_len: u32,
is_large_len: bool,
Expand Down
1 change: 1 addition & 0 deletions src/xxh64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ pub fn xxh64(mut input: &[u8], seed: u64) -> u64 {
}

///XXH64 Streaming algorithm
#[derive(Clone)]
pub struct Xxh64 {
total_len: u64,
v1: u64,
Expand Down

0 comments on commit 3700b45

Please sign in to comment.