2 USING: checksums help.syntax help.markup ;
5 { $class-description "The class of checksum algorithms implemented by OpenSSL. The exact set of algorithms supported depends on how the OpenSSL library was compiled; " { $snippet "md5" } " and " { $snippet "sha1" } " should be universally available." } ;
7 HELP: <openssl-checksum>
8 { $values { "name" "an EVP message digest name" } { "openssl-checksum" openssl-checksum } }
9 { $description "Creates a new OpenSSL checksum object." } ;
12 { $values { "value" checksum } }
13 { $description "The OpenSSL MD5 message digest implementation." } ;
16 { $values { "value" checksum } }
17 { $description "The OpenSSL SHA1 message digest implementation." } ;
20 { $error-description "Thrown by checksum words if they are passed an " { $link openssl-checksum } " naming a message digest not supported by OpenSSL." } ;
22 ARTICLE: "checksums.openssl" "OpenSSL checksums"
23 "The OpenSSL library provides a large number of efficient checksum (message digest) algorithms which may be used independently of its SSL functionality."
24 { $subsections openssl-checksum }
25 "Constructing a checksum from a known name:"
26 { $subsections <openssl-checksum> }
32 "An error thrown if the digest name is unrecognized:"
33 { $subsections unknown-digest }
34 "An example where we compute the SHA1 checksum of a string using the OpenSSL implementation of SHA1:"
35 { $example "USING: byte-arrays checksums checksums.openssl ;" "\"hello world\" >byte-array openssl-sha1 checksum-bytes hex-string ." "\"2aae6c35c94fcfb415dbe95f408b9ce91ee846ed\"" }
36 "If we use the Factor implementation, we get the same result, just slightly slower:"
37 { $example "USING: byte-arrays checksums checksums.sha ;" "\"hello world\" >byte-array sha1 checksum-bytes hex-string ." "\"2aae6c35c94fcfb415dbe95f408b9ce91ee846ed\"" } ;
39 ABOUT: "checksums.openssl"