Skip to content

Commit

Permalink
Initial checking of Tcl sample extension
Browse files Browse the repository at this point in the history
  • Loading branch information
wart committed Aug 4, 1999
1 parent 8aff323 commit b25f82b
Show file tree
Hide file tree
Showing 12 changed files with 5,327 additions and 0 deletions.
499 changes: 499 additions & 0 deletions Makefile.in

Large diffs are not rendered by default.

67 changes: 67 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
sha1 - manipulate sha1 message digests

SHA1 is NIST's Secure Hashing Algorithm (also known as Secure Hashing
Standard) with the minor modification that they proposed on 7/11/94.

To make type:

./configure
make
make install

The configure script will deduce $PREFIX from the tcl installation.
The generated Makefile uses the file $PREFIX/lib/tclConfig.sh that was left by
the make of tcl for most of its configuration parameters.

The Makefile generates pkgIndex.tcl files that are compatible with
tcl7.6. If you are using tcl7.5 then you will need to edit
$PREFIX/lib/pkgIndex.tcl by hand.

Usage:

sha1 ?-log2base log2base? -string string

or

sha1 ?-log2base log2base? ?-copychan chanID? -chan chanID

or

sha1 -init (returns descriptor)
sha1 -update descriptor ?-maxbytes n? ?-copychan chanID? -chan chanID
sha1 ?-log2base log2base? -final descriptor


Switches can be in any order.

Returns a sha1 digest in base 2 ** log2base ascii representation.
log2base defaults to 4, i.e. hex representation.

log2base length chars
1 160 01 (binary)
2 80 0..3
3 54 0...7 (octal)
4 40 0..9a..f (hex)
5 32 0..9a..v
6 27 0..9a..zA..Z_,

(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.)

In the -string version, returns sha1 digest of string.

In the -chan version, returns list of 2 items: length of data
in chanID followed by sha1 digest of all data in chanID. ChanID is
identifier returned from "open" for example. If -copychan is supplied,
will also copy all data from chanID to copychanID.

In the third form, -init returns a descriptor, -update can be called
any number of times with that descriptor and returns the number of
bytes read, and -final returns the result in the same form as the
standalone -chan.

Written by: John Ellson ([email protected])
modified by: Dave Dykstra ([email protected])

Use at your own risk. No support. No copyright.
Loading

0 comments on commit b25f82b

Please sign in to comment.