diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-07-04T12·47+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-07-04T13·07+0200 |
commit | c0015e87af70f539f24d2aa2bc224a9d8b84276b (patch) | |
tree | 3cf099db686920376a0d69c890845767b6aae7a8 /src/libstore/nar-info.cc | |
parent | fe97c6989841460efca37f0f3b9b470c98229283 (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.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/nar-info.cc b/src/libstore/nar-info.cc index d1042c6de25e..660f6a42a19d 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"; |