diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-07-01 23:28:21 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-07-01 23:28:21 +0200 |
commit | 72626a71a96b02fccb2281713c1fdcd09aa194c4 (patch) | |
tree | f24a4f73ee47d6478b5ef3a48ddb16e6403b7275 /guix/utils.scm | |
parent | 82323a80850a205866c83a9399cc76336e30847d (diff) | |
download | gnu-guix-72626a71a96b02fccb2281713c1fdcd09aa194c4.tar gnu-guix-72626a71a96b02fccb2281713c1fdcd09aa194c4.tar.gz |
Move `sha256' to (guix hash).
* guix/utils.scm (sha256): Move to...
* guix/hash.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
* guix/derivations.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/scripts/refresh.scm, tests/base32.scm,
tests/derivations.scm, tests/store.scm: Use (guix hash).
Diffstat (limited to 'guix/utils.scm')
-rw-r--r-- | guix/utils.scm | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/guix/utils.scm b/guix/utils.scm index 2478fb6939..4187efde41 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -36,7 +36,6 @@ #:autoload (system foreign) (pointer->procedure) #:export (bytevector->base16-string base16-string->bytevector - sha256 %nixpkgs-directory nixpkgs-derivation @@ -138,23 +137,6 @@ evaluate to a simple datum." s) bv))) - -;;; -;;; Hash. -;;; - -(define sha256 - (let ((hash (pointer->procedure void - (dynamic-func "gcry_md_hash_buffer" - (dynamic-link %libgcrypt)) - `(,int * * ,size_t))) - (sha256 8)) ; GCRY_MD_SHA256, as of 1.5.0 - (lambda (bv) - "Return the SHA256 of BV as a bytevector." - (let ((digest (make-bytevector (/ 256 8)))) - (hash sha256 (bytevector->pointer digest) - (bytevector->pointer bv) (bytevector-length bv)) - digest)))) ;;; |