Handbook
Glossary
end-case ( seq hash -- hash' )
Vocabulary
checksums
.
superfast
.
private
Inputs
seq
an
object
hash
an
object
Outputs
hash'
an
object
Definition
USING:
endian
kernel
math
math.bitwise
sequences
sequences.private
;
IN:
checksums.superfast.private
:
end-case
( seq hash -- hash' )
swap
dup
length
4
mod
[
tail-slice*
]
keep
{
[
drop
]
[
first
+
[
10
shift
]
[
bitxor
]
bi
32
bits
[
-1
shift
]
[
+
]
bi
]
[
le>
+
[
11
shift
]
[
bitxor
]
bi
32
bits
[
-17
shift
]
[
+
]
bi
]
[
unclip-last-slice
[
le>
+
[
16
shift
]
[
bitxor
]
bi
]
[
18
shift
bitxor
]
bi*
32
bits
[
-11
shift
]
[
+
]
bi
]
}
dispatch
;
inline