diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2025-02-20 08:47:48 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-20 08:47:48 +0000 |
| commit | 82ddf358d0a319ba0eefd838bb80cf526daf9dcb (patch) | |
| tree | 0d432e0952d0c207f186407bd06a610e7e74e6dc /src/common.cpp | |
| parent | f0b1357132de38e9dad0964ebe4c21db1ed4f430 (diff) | |
| parent | 29456bcdea6e9567a9655e49a948f9e57920ff7a (diff) | |
Merge pull request #4855 from odin-lang/bill/canonical-type-hashing
Deterministic Canonical Naming for Link Names and Types
Diffstat (limited to 'src/common.cpp')
| -rw-r--r-- | src/common.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common.cpp b/src/common.cpp index 0ef39bd10..ad1e5a851 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -134,9 +134,9 @@ gb_internal u32 fnv32a(void const *data, isize len) { return h; } -gb_internal u64 fnv64a(void const *data, isize len) { +gb_internal u64 fnv64a(void const *data, isize len, u64 seed=0xcbf29ce484222325ull) { u8 const *bytes = cast(u8 const *)data; - u64 h = 0xcbf29ce484222325ull; + u64 h = seed; for (; len >= 8; len -= 8, bytes += 8) { h = (h ^ bytes[0]) * 0x100000001b3ull; |