HashAdd32 adds a string to a fnv32 hash value, returning the updated hash. Note this is the same algorithm as Go stdlib `sum32.Write()`
(h uint32, s string)
| 53 | // HashAdd32 adds a string to a fnv32 hash value, returning the updated hash. |
| 54 | // Note this is the same algorithm as Go stdlib `sum32.Write()` |
| 55 | func HashAdd32(h uint32, s string) uint32 { |
| 56 | for i := 0; i < len(s); i++ { |
| 57 | h *= prime32 |
| 58 | h ^= uint32(s[i]) |
| 59 | } |
| 60 | return h |
| 61 | } |
| 62 | |
| 63 | // HashAddByte32 adds a byte to a fnv32 hash value, returning the updated hash. |
| 64 | func HashAddByte32(h uint32, b byte) uint32 { |