mirror of
https://git.intege.rs/xlib/x.git
synced 2025-12-05 20:35:01 +00:00
.
This commit is contained in:
@@ -26,11 +26,11 @@ pub const fn hash32(bytes: &[u32]) -> u64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//noinspection DuplicatedCode
|
//noinspection DuplicatedCode
|
||||||
pub const fn hash64(bytes: &[u32]) -> u64 {
|
pub const fn hash64(bytes: &[u64]) -> u64 {
|
||||||
let mut hash = INITIAL_STATE;
|
let mut hash = INITIAL_STATE;
|
||||||
let mut i = 0;
|
let mut i = 0;
|
||||||
while i < bytes.len() {
|
while i < bytes.len() {
|
||||||
hash = hash ^ bytes[i] as u64;
|
hash = hash ^ bytes[i];
|
||||||
hash = hash.wrapping_mul(PRIME);
|
hash = hash.wrapping_mul(PRIME);
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user