-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsha1.n
65 lines (65 loc) · 2.15 KB
/
sha1.n
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
'\"
.so man.macros
.TH sha1 n 4.1 "Tcl-Extensions"
.HS sha1 tcl
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
sha1 \- manipulate sha1 message digests
.SH SYNOPSIS
\fBpackage require sample\fR ?\fB0.6\fR?
.sp
\fBsha1\fR ?\fB\-log2base \fIlog2base\fR? \fB\-string \fIstring\fR
.br
or
.br
\fBsha1\fR ?\fB\-log2base \fIlog2base\fR? ?\fB\-copychan \fIcopyChanID\fR? \fB\-chan \fIchanID\fR
.br
or
.br
\fBsha1 \-init\fR (returns descriptor)
.br
\fBsha1 \-update \fIdescriptor\fR ?\fB\-maxbytes \fIn\fR? ?\fB\-copychan \fIchanID\fR? \fB\-chan \fIchanID\fR
.br
\fBsha1\fR ?\fB\-log2base \fIlog2base\fR? \fB\-final \fIdescriptor\fR
.BE
.SH DESCRIPTION
.PP
SHA1 is NIST's Secure Hashing Algorithm (also known as Secure Hashing
Standard) with the minor modification that they proposed on 7/11/94.
.PP
Switches can be in any order.
.PP
Returns a sha1 digest in base 2 ** log2base ascii representation.
log2base defaults to 4, i.e., hex representation.
.PP
.nf
\fBlog2base length chars\fR
1 160 01 \fI(binary)\fR
2 80 0..3
3 54 0...7 \fI(octal)\fR
4 40 0..9a..f \fI(hex)\fR
5 32 0..9a..v
6 27 0..9a..zA..Z_,
.fi
.PP
(The characters in the digest string have been chosen to be usable in
filenames so that the sha1 command can be used, for example, to digest URLs
into shorter strings for filenames in a cache.)
.PP
In the \fB\-string\fR version, returns sha1 digest alone of \fIstring\fR.
.PP
In the \fB\-chan\fR version, returns list of 2 items: length of data in
\fIchanID\fR followed by sha1 digest of all data in \fIchanID\fR.
\fIChanID\fR is identifier returned from "\fBopen\fR" for example. If
\fB\-copychan\fR is supplied, will also copy all data from \fIchanID\fR to
\fIcopychanID\fR.
.PP
In the third form, \fB\-init\fR returns a descriptor, \fB\-update\fR can be
called any number of times with that descriptor and returns the number of
bytes read, and \fB\-final\fR returns the result in the same form as the
standalone \fB\-chan\fR.
'\" Local Variables:
'\" mode: nroff
'\" fill-column: 78
'\" End: