mirror of
https://github.com/NixOS/nix.git
synced 2025-11-20 09:19:36 +01:00
libutils/hash: remove default encoding
This will make it easier to reason about the hash encoding and switch to SRI everywhere where possible.
This commit is contained in:
parent
01572c2198
commit
6ee03b8444
15 changed files with 40 additions and 40 deletions
|
|
@ -196,9 +196,9 @@ struct TarballInput : Input
|
|||
// NAR hashes are preferred over file hashes since tar/zip files
|
||||
// don't have a canonical representation.
|
||||
if (narHash)
|
||||
url2.query.insert_or_assign("narHash", narHash->to_string(SRI));
|
||||
url2.query.insert_or_assign("narHash", narHash->to_string(SRI, true));
|
||||
else if (hash)
|
||||
url2.query.insert_or_assign("hash", hash->to_string(SRI));
|
||||
url2.query.insert_or_assign("hash", hash->to_string(SRI, true));
|
||||
return url2;
|
||||
}
|
||||
|
||||
|
|
@ -207,7 +207,7 @@ struct TarballInput : Input
|
|||
Attrs attrs;
|
||||
attrs.emplace("url", url.to_string());
|
||||
if (hash)
|
||||
attrs.emplace("hash", hash->to_string(SRI));
|
||||
attrs.emplace("hash", hash->to_string(SRI, true));
|
||||
return attrs;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue