Skip to content

Latest commit

 

History

History
72 lines (51 loc) · 1.43 KB

README.md

File metadata and controls

72 lines (51 loc) · 1.43 KB

sha2

Index

Intro

Implementation of the SHA-2 (Secure Hash Algorithm) cryptographic hash, ported from Chibi Scheme's (chibi crypto sha2) library.

Dependencies

None

Test-dependencies

None

Foreign-dependencies

None

API

(cyclone crypto sha2)

[procedure] (sha-224 src)

Computes SHA-224 digest of the src which can be a string, a bytevector, or a binary input port. Returns a hexadecimal string (in lowercase).

[procedure] (sha-256 src)

Computes SHA-256 digest of the src which can be a string, a bytevector, or a binary input port. Returns a hexadecimal string (in lowercase).

Examples

;; An example program to compute SHA256 of a file
(import (scheme base) (scheme write) (cyclone crypto sha2))

(when (null? (command-line-arguments))
  (display "Usage: sha256sum-cyc FILE")
  (newline)
  (exit 1))

(display
  (sha-256 (open-binary-input-file (car (command-line-arguments)))))
(display "  ")
(display (car (command-line-arguments)))
(newline)

Author(s)

Alex Shinn, Alexei Lozovsky

Maintainer(s)

Justin Ethier

Version

"0.3.0"

License

BSD

Tags

crypto networking hash