source: project/wiki/eggref/4/sha2 @ 31027

Last change on this file since 31027 was 31027, checked in by Kon Lovett, 6 years ago

add block-length

File size: 3.1 KB
Line 
1[[tags: egg]]
2
3== sha2
4
5[[toc:]]
6
7
8== Documentation
9
10Computes SHA2 checksums
11
12=== Digest Procedures
13
14Any Scheme-object can be the {{SOURCE}} for a digest.
15See [[message-digest]] for more information.
16
17==== sha256-primitive
18
19<procedure>(sha256-primitive)</procedure>
20
21Returns the 256-bit checksum primitive object.
22
23==== sha384-primitive
24
25<procedure>(sha384-primitive)</procedure>
26
27Returns the 384-bit checksum primitive object.
28
29==== sha512-primitive
30
31<procedure>(sha512-primitive)</procedure>
32
33Returns the 512-bit checksum primitive object.))
34
35
36== Usage
37
38<enscript language=scheme>
39(require-extension sha2)
40</enscript>
41
42
43== Examples
44
45<enscript highlight="scheme">
46(use sha2 message-digest)
47
48(message-digest-string (sha256-primitive) "abc")
49 ;=> "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"
50</enscript>
51
52
53== Requirements
54
55[[message-digest|message-digest]]
56
57
58== Notes
59
60* For use with the [[message-digest|message-digest]] extension.
61
62
63== Author
64
65* Aaron D. Gifford, wrapped for Chicken by Daishi Kato
66* [[/users/kon-lovett|Kon Lovett]]
67
68
69== Version history
70
71; 3.1.0 : Add block-length. [[/users/kon-lovett|Kon Lovett]]
72; 3.0.0 : Remove deprecated procedures. [[/users/kon-lovett|Kon Lovett]]
73; 2.1.1 : Change deprecated {{pointer}} foreign type specifier to {{scheme-pointer}} to make it work under chickens newer than 4.6.0.
74; 2.0.1 : a {{message-digest-primitive}} has no "state". [[/users/kon-lovett|Kon Lovett]]
75; 2.0.1 : fix for [[http://www.irp.oist.jp/trac/chicken/ticket/163|#163]] ([[/users/mario-domenech-goulart|Mario Domenech Goulart]])
76; 2.0.0 : Initial Chicken 4 release [[/users/kon-lovett|Kon Lovett]]
77
78
79== License
80
81Copyright (c) 2000-2001, Aaron D. Gifford and Daishi Kato
82All rights reserved.
83
84Redistribution and use in source and binary forms, with or without
85modification, are permitted provided that the following conditions
86are met:
87
881. Redistributions of source code must retain the above copyright
89   notice, this list of conditions and the following disclaimer.
902. Redistributions in binary form must reproduce the above copyright
91   notice, this list of conditions and the following disclaimer in the
92   documentation and/or other materials provided with the distribution.
933. Neither the name of the copyright holder nor the names of contributors
94   may be used to endorse or promote products derived from this software
95   without specific prior written permission.
96
97THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND
98ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
99IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
100ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE
101FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
102DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
103OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
104HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
105LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
106OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
107SUCH DAMAGE.
Note: See TracBrowser for help on using the repository browser.