Handbook
Glossary
get-checksum ( checksum-state -- value )
Factor handbook
»
Input and output
»
Checksums
Prev:
add-checksum-file ( checksum-state path -- checksum-state )
Vocabulary
checksums
Inputs
checksum-state
an
object
Outputs
value
an
object
Definition
IN:
checksums
GENERIC:
get-checksum
( checksum-state -- value )
Methods
USING:
accessors
checksums
kernel
;
M:
checksum-state
get-checksum
[
bytes>>
]
[
checksum>>
]
bi
checksum-bytes
;
USING:
accessors
alien.c-types
alien.data
checksums
checksums.openssl.private
openssl
openssl.libcrypto
;
M:
evp-md-context
get-checksum
handle>>
{
{
int
EVP_MAX_MD_SIZE
}
int
}
[
EVP_DigestFinal_ex
ssl-error
]
with-out-parameters
memory>byte-array
;
USING:
accessors
checksums
checksums.common
checksums.md5
checksums.md5.private
kernel
sequences
;
M:
md5-state
get-checksum
clone
[
bytes>>
f
]
[
bytes-read>>
pad-last-block
]
[
]
tri
[
[
checksum-block
]
curry
each
]
[
md5>checksum
]
bi
;
USING:
accessors
checksums
checksums.multi
kernel
sequences
;
M:
multi-state
get-checksum
dup
results>>
[
dup
states>>
[
get-checksum
]
map
[
>>results
]
keep
]
unless*
nip
;
USING:
accessors
checksums
checksums.process
destructors
hex-strings
io
kernel
;
M:
process-state
get-checksum
dup
result>>
[
dup
process>>
[
[
[
out>>
dispose
]
keep
stream-contents
trim-hash
hex-string>bytes
]
with-disposal
]
[
B{
}
]
if*
[
>>result
]
keep
]
unless*
nip
;
USING:
accessors
checksums
checksums.common
checksums.ripemd
checksums.ripemd.private
kernel
sequences
;
M:
ripemd-160-state
get-checksum
clone
[
bytes>>
f
]
[
bytes-read>>
pad-last-block
]
[
]
tri
[
[
checksum-block
]
curry
each
]
[
ripemd-160>checksum
]
bi
;
USING:
checksums
checksums.sha.private
kernel
;
M:
sha-224-state
get-checksum
clone
[
pad-last-short-block
]
[
sha-224>checksum
]
bi
;
USING:
checksums
checksums.sha.private
kernel
;
M:
sha-256-state
get-checksum
clone
[
pad-last-short-block
]
[
sha-256>checksum
]
bi
;
USING:
checksums
checksums.sha.private
kernel
;
M:
sha1-state
get-checksum
clone
[
pad-last-short-block
]
[
sha-256>checksum
]
bi
;