aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/content-address.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/content-address.cc')
-rw-r--r--src/libstore/content-address.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/content-address.cc b/src/libstore/content-address.cc
index f30f53ff8..5bf51cb97 100644
--- a/src/libstore/content-address.cc
+++ b/src/libstore/content-address.cc
@@ -21,7 +21,7 @@ std::string makeFixedOutputCA(FileIngestionMethod method, const Hash & hash)
{
return "fixed:"
+ makeFileIngestionPrefix(method)
- + hash.to_string();
+ + hash.to_string(Base32, true);
}
// FIXME Put this somewhere?
@@ -31,7 +31,7 @@ template<class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
std::string renderContentAddress(ContentAddress ca) {
return std::visit(overloaded {
[](TextHash th) {
- return "text:" + th.hash.to_string();
+ return "text:" + th.hash.to_string(Base::Base32, true);
},
[](FileSystemHash fsh) {
return makeFixedOutputCA(fsh.method, fsh.hash);
@@ -46,7 +46,7 @@ ContentAddress parseContentAddress(std::string_view rawCa) {
if (prefix == "text") {
auto hashTypeAndHash = rawCa.substr(prefixSeparator+1, string::npos);
Hash hash = Hash(string(hashTypeAndHash));
- if (*hash.type != HashType::SHA256) {
+ if (*hash.type != htSHA256) {
throw Error("parseContentAddress: the text hash should have type SHA256");
}
return TextHash { hash };