sdk: Allow any byte stream for hashing dictionary entries
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/linux Build for the target platform: linux
build/msvc Build for the target platform: msvc
All checks were successful
lint/clippy Checking for common mistakes and opportunities for code improvement
build/linux Build for the target platform: linux
build/msvc Build for the target platform: msvc
This commit is contained in:
parent
c997489e18
commit
f1f9a818cc
1 changed files with 4 additions and 4 deletions
|
@ -147,14 +147,14 @@ impl Dictionary {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn add(&mut self, value: String, group: HashGroup) {
|
||||
let long = Murmur64::from(murmurhash64::hash(value.as_bytes(), SEED as u64));
|
||||
let short = Murmur32::from(murmurhash64::hash32(value.as_bytes(), SEED));
|
||||
pub fn add(&mut self, value: impl AsRef<[u8]>, group: HashGroup) {
|
||||
let long = Murmur64::from(murmurhash64::hash(value.as_ref(), SEED as u64));
|
||||
let short = Murmur32::from(murmurhash64::hash32(value.as_ref(), SEED));
|
||||
|
||||
let entry = Entry {
|
||||
long,
|
||||
short,
|
||||
value,
|
||||
value: String::from_utf8_lossy(value.as_ref()).to_string(),
|
||||
group,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue