SectrPrototype/code/grime/hashing.odin
2025-01-03 13:06:05 -05:00

6 lines
172 B
Odin

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