aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-11-03 11:44:19 +0000
committergingerBill <bill@gingerbill.org>2022-11-03 11:44:19 +0000
commite8bc576b238178e44d91f0fad6bf541ecb875a91 (patch)
tree6925431b157ffa03c23b346ad2ed9a4e9f77db5d
parent2eea6f2490e1e436c6ebe854072b64f9d0d356f8 (diff)
Rename `fnv32` and `fnv64` to `fnv32_no_a` and `fnv64_no_a`
-rw-r--r--core/hash/hash.odin6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/hash/hash.odin b/core/hash/hash.odin
index 870d6a638..37c15b994 100644
--- a/core/hash/hash.odin
+++ b/core/hash/hash.odin
@@ -72,8 +72,9 @@ djbx33a :: proc(data: []byte, seed := u32(5381)) -> (result: [16]byte) #no_bound
return
}
+// If you have a choice, prefer fnv32a
@(optimization_mode="speed")
-fnv32 :: proc(data: []byte, seed := u32(0x811c9dc5)) -> u32 {
+fnv32_no_a :: proc(data: []byte, seed := u32(0x811c9dc5)) -> u32 {
h: u32 = seed
for b in data {
h = (h * 0x01000193) ~ u32(b)
@@ -81,8 +82,9 @@ fnv32 :: proc(data: []byte, seed := u32(0x811c9dc5)) -> u32 {
return h
}
+// If you have a choice, prefer fnv64a
@(optimization_mode="speed")
-fnv64 :: proc(data: []byte, seed := u64(0xcbf29ce484222325)) -> u64 {
+fnv64_no_a :: proc(data: []byte, seed := u64(0xcbf29ce484222325)) -> u64 {
h: u64 = seed
for b in data {
h = (h * 0x100000001b3) ~ u64(b)