]> gitweb.factorcode.org Git - factor.git/blob - basis/checksums/openssl/openssl-docs.factor
docs: change $subsection to $subsections
[factor.git] / basis / checksums / openssl / openssl-docs.factor
1 IN: checksums.openssl
2 USING: checksums help.syntax help.markup ;
3
4 HELP: openssl-checksum
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." } ;
6
7 HELP: <openssl-checksum>
8 { $values { "name" "an EVP message digest name" } { "openssl-checksum" openssl-checksum } }
9 { $description "Creates a new OpenSSL checksum object." } ;
10
11 HELP: openssl-md5
12 { $values { "value" checksum } }
13 { $description "The OpenSSL MD5 message digest implementation." } ;
14
15 HELP: openssl-sha1
16 { $values { "value" checksum } }
17 { $description "The OpenSSL SHA1 message digest implementation." } ;
18
19 HELP: unknown-digest
20 { $error-description "Thrown by checksum words if they are passed an " { $link openssl-checksum } " naming a message digest not supported by OpenSSL." } ;
21
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> }
27 "Two utility words:"
28 { $subsections
29     openssl-md5
30     openssl-sha1
31 }
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\"" } ;
38
39 ABOUT: "checksums.openssl"