Skip to content

Secure Hash Algorithm 2 (SHA-2) library for Cyclone Scheme

Notifications You must be signed in to change notification settings

cyclone-scheme/sha2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Secure Hash Algorithm 2 (SHA-2) library for Cyclone Scheme

Resources

Stars

Watchers

Forks

Packages

No packages published