2025-01-03 10:06:05 -08:00
|
|
|
package grime
|
|
|
|
|
2025-01-03 20:06:31 -08:00
|
|
|
djb8_hash_32 :: #force_inline proc "contextless" ( hash : ^u32, bytes : []byte ) {
|
|
|
|
for value in bytes do (hash^) = (( (hash^) << 8) + (hash^) ) + u32(value)
|
|
|
|
}
|
|
|
|
|
2025-01-03 10:06:05 -08:00
|
|
|
djb8_hash :: #force_inline proc "contextless" ( hash : ^u64, bytes : []byte ) {
|
|
|
|
for value in bytes do (hash^) = (( (hash^) << 8) + (hash^) ) + u64(value)
|
|
|
|
}
|