M guix/derivations.scm => guix/derivations.scm +0 -6
@@ 25,9 25,6 @@
#:use-module (ice-9 match)
#:use-module (ice-9 rdelim)
#:use-module (guix store)
- #:use-module ((chop hash)
- #:select (bytevector-hash
- hash-method/sha256))
#:export (derivation?
derivation-outputs
derivation-inputs
@@ 187,9 184,6 @@ that form."
env-vars))
(display ")" port))))
-(define (sha256 bv)
- "Return the SHA256 of BV as a bytevector."
- (bytevector-hash hash-method/sha256 bv))
(define (derivation-hash drv) ; `hashDerivationModulo' in derivations.cc
"Return the hash of DRV, modulo its fixed-output inputs, as a bytevector."
M guix/utils.scm => guix/utils.scm +14 -1
@@ 19,9 19,13 @@
(define-module (guix utils)
#:use-module (srfi srfi-60)
#:use-module (rnrs bytevectors)
+ #:use-module ((chop hash)
+ #:select (bytevector-hash
+ hash-method/sha256))
#:export (bytevector-quintet-length
bytevector->base32-string
- bytevector->nix-base32-string))
+ bytevector->nix-base32-string
+ sha256))
(define bytevector-quintet-ref
(let* ((ref bytevector-u8-ref)
@@ 98,3 102,12 @@ the previous application or INIT."
(define bytevector->nix-base32-string
(make-bytevector->base32-string %nix-base32-chars))
+
+;;;
+;;; Hash.
+;;;
+
+(define (sha256 bv)
+ "Return the SHA256 of BV as a bytevector."
+ (bytevector-hash hash-method/sha256 bv))
+