Skip to content
cyclone-scheme edited this page Jul 6, 2021 · 4 revisions

Content automatically generated. Contributions from the community are very welcomed at the bottom of this file.

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


Contributions from the community:

Clone this wiki locally