sha1

  1. sha1
  2. Documentation
    1. SHA1 API
      1. Usage
      2. Constants
      3. init
      4. update
      5. raw-update
      6. final
    2. SHA1 Primitive
      1. Usage
      2. sha1-primitive
  3. Usage
  4. Example
  5. Notes
  6. Requirements
  7. Author
  8. Repository
  9. Version history
  10. License

Documentation

Computes SHA1 (FIPS-180-1) checksums

See message-digest-primitive for more information.

SHA1 API

Component export

Usage

(use sha1-api)

Constants

name
algorithm name ; symbol
version
algorithm version ; string
context-size
context byte length ; fixnum
digest-length
final byte length ; fixnum
block-length
buffer byte length ; fixnum

Note that block-length is informational only.

init

[procedure] (init CTX)

Initializes a SHA1 CTX, with at least context-size byte size.

update

[procedure] (update CTX OBJ LEN)

Accumulate LEN bytes from the Scheme OBJ into CTX.

raw-update

[procedure] (raw-update CTX PTR LEN)

Accumulate LEN bytes from the byte PTR into CTX.

final

[procedure] (final CTX OBJ)

Finalize the CTX into a Scheme OBJ with at least digest-length byte size. The target is usually a bytevector.

SHA1 Primitive

Packaged export

Usage

(use sha1-primitive)

sha1-primitive

[procedure] (sha1-primitive) -> message-digest-primitive

Returns the SHA1 checksum digest primitive object.

Usage

(import sha1)

Example

(import sha1-primitive message-digest-byte-vector)

(message-digest-string (sha1-primitive) "abc")
;=> "a9993e364706816aba3e25717850c26c9cd0d89d"

Notes

Requirements

message-digest-primitive

Author

Steve Reid, packaged for Chicken by Peter Bex, C5 by kon lovett

Repository

This egg is hosted on the CHICKEN Subversion repository:

https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/sha1

If you want to check out the source code repository of this egg and you are not familiar with Subversion, see this page.

Version history

4.2.0
CHICKEN 5 release.

License

 SHA-1 in C
 By Steve Reid <steve@edmweb.com>
 100% Public Domain