chibi-scheme/lib/chibi/crypto/sha2.sld
Alex Shinn 00691b64f1 Making libraries portable where possible.
Many still import (chibi), and as (scheme base) is somewhat more
expensive to load at present these are changed to cond-expand.
Many libraries also rely on (srfi 33), and these have been changed
to a cond-expand first trying (srfi 60) where available.
Also fixing a few portability concerns (duplicate imports of the
same binding), and adding a few libraries missing from lib-tests.scm.
2015-04-26 16:17:38 +09:00

26 lines
729 B
Scheme

(define-library (chibi crypto sha2)
(import (scheme base))
(export sha-224 sha-256)
(cond-expand
(chibi
(include "sha2-native.scm")
(include-shared "crypto"))
(else
(cond-expand
((library (srfi 60)) (import (srfi 60)))
(else (import (srfi 33))))
(import (chibi bytevector))
(include "sha2.scm"))))
;;> \procedure{(sha-224 src)}
;;>
;;> Computes SHA-224 digest of the \var{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 \var{src} which can be a string,
;;> a bytevector, or a binary input port. Returns a hexadecimal string
;;> (in lowercase).