Handbook
Glossary
check-crc ( bytes metadata key -- )
Vocabulary
yenc
.
private
Inputs
bytes
an
object
metadata
an
object
key
an
object
Outputs
None
Definition
USING:
assocs
checksums
checksums.crc32
endian
kernel
math.parser
sequences
yenc
;
IN:
yenc.private
::
check-crc
( bytes metadata key -- )
key metadata
at
[
dup
length
8
=
over
[
"0123456789abcdefABCDEF"
member?
]
all?
and
[
hex>
]
[
"Invalid CRC32"
invalid-yenc
]
if
bytes
crc32
checksum-bytes
be>
=
[
"CRC32 mismatch"
invalid-yenc
]
unless
]
when*
;