aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/nar-info.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/nar-info.cc
parentfe97c6989841460efca37f0f3b9b470c98229283 (diff)
Support base-64 hashes
Also simplify the Hash API. Fixes #1437.
Diffstat (limited to 'src/libstore/nar-info.cc')
-rw-r--r--src/libstore/nar-info.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/nar-info.cc b/src/libstore/nar-info.cc
index d1042c6de..660f6a42a 100644
--- a/src/libstore/nar-info.cc
+++ b/src/libstore/nar-info.cc
@@ -11,7 +11,7 @@ NarInfo::NarInfo(const Store & store, const std::string & s, const std::string &
auto parseHashField = [&](const string & s) {
try {
- return parseHash(s);
+ return Hash(s);
} catch (BadHash &) {
corrupt();
return Hash(); // never reached
@@ -90,10 +90,10 @@ std::string NarInfo::to_string() const
assert(compression != "");
res += "Compression: " + compression + "\n";
assert(fileHash.type == htSHA256);
- res += "FileHash: sha256:" + printHash32(fileHash) + "\n";
+ res += "FileHash: " + fileHash.to_string(Base32) + "\n";
res += "FileSize: " + std::to_string(fileSize) + "\n";
assert(narHash.type == htSHA256);
- res += "NarHash: sha256:" + printHash32(narHash) + "\n";
+ res += "NarHash: " + narHash.to_string(Base32) + "\n";
res += "NarSize: " + std::to_string(narSize) + "\n";
res += "References: " + concatStringsSep(" ", shortRefs()) + "\n";