mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
[hash] Give crc-64 a 64-bit seed.
This commit is contained in:
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
package hash
|
package hash
|
||||||
|
|
||||||
@(optimization_mode="speed")
|
@(optimization_mode="speed")
|
||||||
crc64_ecma_182 :: proc(data: []byte, seed := u32(0)) -> u64 #no_bounds_check {
|
crc64_ecma_182 :: proc(data: []byte, seed := u64(0)) -> (result: u64) #no_bounds_check {
|
||||||
result := u64(seed)
|
result = seed
|
||||||
#no_bounds_check for b in data {
|
#no_bounds_check for b in data {
|
||||||
result = result<<8 ~ _crc64_table_ecma_182[((result>>56) ~ u64(b)) & 0xff]
|
result = result<<8 ~ _crc64_table_ecma_182[((result>>56) ~ u64(b)) & 0xff]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user