2 USING: 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 { $description "The OpenSSL MD5 message digest implementation." } ;
15 { $description "The OpenSSL SHA1 message digest implementation." } ;
18 { $error-description "Thrown by checksum words if they are passed an " { $link openssl-checksum } " naming a message digest not supported by OpenSSL." } ;
20 ARTICLE: "checksums.openssl" "OpenSSL checksums"
21 "The OpenSSL library provides a large number of efficient checksum (message digest) algorithms which may be used independently of its SSL functionality."
22 { $subsection openssl-checksum }
23 "Constructing a checksum from a known name:"
24 { $subsection <openssl-checksum> }
26 { $subsection openssl-md5 }
27 { $subsection openssl-sha1 }
28 "An error thrown if the digest name is unrecognized:"
29 { $subsection unknown-digest }
30 "An example where we compute the SHA1 checksum of a string using the OpenSSL implementation of SHA1:"
31 { $example "USING: byte-arrays checksums checksums.openssl prettyprint ;" "\"hello world\" >byte-array openssl-sha1 checksum-bytes hex-string ." "\"2aae6c35c94fcfb415dbe95f408b9ce91ee846ed\"" }
32 "If we use the Factor implementation, we get the same result, just slightly slower:"
33 { $example "USING: byte-arrays checksums checksums.sha1 prettyprint ;" "\"hello world\" >byte-array sha1 checksum-bytes hex-string ." "\"2aae6c35c94fcfb415dbe95f408b9ce91ee846ed\"" } ;
35 ABOUT: "checksums.openssl"