aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-01-29 21:01:59 +0100
committerGravatar Runxi Yu2026-01-29 21:01:59 +0100
commitfd89c1614193d5d86b1606e1819172fca3473311 (patch)
tree4752a55b933d9e97befcb98025dc5dadae68fae1 /internal
parentdelta, packed: Use xxhash instead of murmurhash2 (diff)
signatureNo signature
murmurhash2: Delete
Diffstat (limited to 'internal')
-rw-r--r--internal/murmurhash2/murmurhash2.go42
1 files changed, 0 insertions, 42 deletions
diff --git a/internal/murmurhash2/murmurhash2.go b/internal/murmurhash2/murmurhash2.go
deleted file mode 100644
index c728f932..00000000
--- a/internal/murmurhash2/murmurhash2.go
+++ /dev/null
@@ -1,42 +0,0 @@
-// Package murmurhash2 provides a non-cryptographic hash.
-package murmurhash2
-
-import "encoding/binary"
-
-// Sum32 computes the MurmurHash2 value for key with the provided seed.
-func Sum32(key []byte, seed uint32) uint32 {
- const (
- m uint32 = 0x5bd1e995
- r uint32 = 24
- )
-
- h := seed ^ uint32(len(key))
- i := 0
- for len(key)-i >= 4 {
- k := binary.LittleEndian.Uint32(key[i:])
- k *= m
- k ^= k >> r
- k *= m
-
- h *= m
- h ^= k
- i += 4
- }
-
- switch len(key) - i {
- case 3:
- h ^= uint32(key[i+2]) << 16
- fallthrough
- case 2:
- h ^= uint32(key[i+1]) << 8
- fallthrough
- case 1:
- h ^= uint32(key[i])
- h *= m
- }
-
- h ^= h >> 13
- h *= m
- h ^= h >> 15
- return h
-}