aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/derivations.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-07-04 14:47:59 +0200
committerEelco Dolstra <edolstra@gmail.com>2017-07-04 15:07:41 +0200
commitc0015e87af70f539f24d2aa2bc224a9d8b84276b (patch)
tree3cf099db686920376a0d69c890845767b6aae7a8 /src/libstore/derivations.cc
parentfe97c6989841460efca37f0f3b9b470c98229283 (diff)
Support base-64 hashes
Also simplify the Hash API. Fixes #1437.
Diffstat (limited to 'src/libstore/derivations.cc')
-rw-r--r--src/libstore/derivations.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc
index bb7b8fe62..48c0837ff 100644
--- a/src/libstore/derivations.cc
+++ b/src/libstore/derivations.cc
@@ -23,7 +23,7 @@ void DerivationOutput::parseHashInfo(bool & recursive, Hash & hash) const
if (hashType == htUnknown)
throw Error(format("unknown hash algorithm ‘%1%’") % algo);
- hash = parseHash(hashType, this->hash);
+ hash = Hash(this->hash, hashType);
}
@@ -354,7 +354,7 @@ Hash hashDerivationModulo(Store & store, Derivation drv)
h = hashDerivationModulo(store, drv2);
drvHashes[i.first] = h;
}
- inputs2[printHash(h)] = i.second;
+ inputs2[h.to_string(Base16, false)] = i.second;
}
drv.inputDrvs = inputs2;
@@ -437,7 +437,7 @@ Sink & operator << (Sink & out, const BasicDerivation & drv)
std::string hashPlaceholder(const std::string & outputName)
{
// FIXME: memoize?
- return "/" + printHash32(hashString(htSHA256, "nix-output:" + outputName));
+ return "/" + hashString(htSHA256, "nix-output:" + outputName).to_string(Base32, false);
}