Files
SectrPrototype/code/grime/hashing.odin
Ed_ 73bfdb63ea misc changes
mostly added kt1l from watl exercise
2025-08-07 10:53:35 -04:00

10 lines
335 B
Odin

package grime
djb8_hash_32 :: #force_inline proc "contextless" ( hash : ^u32, bytes : []byte ) {
for value in bytes do (hash^) = (( (hash^) << 8) + (hash^) ) + u32(value)
}
hash64_djb8 :: #force_inline proc "contextless" ( hash : ^u64, bytes : []byte ) {
for value in bytes do (hash^) = (( (hash^) << 8) + (hash^) ) + u64(value)
}