Handbook
Glossary
hash32-long ( bytes -- hash )
Vocabulary
checksums
.
cityhash
.
private
Inputs
bytes
an
object
Outputs
hash
an
object
Definition
USING:
math
math.bitwise
sequences
;
IN:
checksums.cityhash.private
::
hash32-long
( bytes -- hash )
bytes
length
:>
len len bytes len 4
-
fetch32
mur
bytes len 16
-
fetch32
mur
:>
h! len
c1
w*
bytes len 8
-
fetch32
mur
bytes len 12
-
fetch32
mur
:>
g! len
c1
w*
bytes len 20
-
fetch32
mix32
w+
step32
:>
f! len 1
-
20
/i
<iota>
[|
i |
i 20
*
:>
offset bytes offset
fetch32
mix32
:>
a0 bytes offset 4
+
fetch32
:>
a1 bytes offset 8
+
fetch32
mix32
:>
a2 bytes offset 12
+
fetch32
mix32
:>
a3 bytes offset 16
+
fetch32
:>
a4 h a0
bitxor
-18
bitroll-32
5
w*
3864292196
w+
h! f a1
w+
-19
bitroll-32
c1
w*
f! g a2
w+
-18
bitroll-32
5
w*
3864292196
w+
g! h a3 a1
w+
bitxor
step32
h! g a4
bitxor
swap32
5
w*
g! h a4 5
w*
w+
swap32
h! f a0
w+
f! f h g f! g! h!
]
each
h g f
finish32
;