mirror of
https://github.com/NixOS/nix
synced 2025-07-01 04:18:00 +02:00
Add newHashAllowEmpty helper function
This replaces the copy&paste with a helper function in hash.hh.
This commit is contained in:
parent
19aa892f20
commit
b260c9ee03
6 changed files with 24 additions and 38 deletions
|
@ -94,6 +94,8 @@ struct Hash
|
|||
}
|
||||
};
|
||||
|
||||
/* Helper that defaults empty hashes to the 0 hash. */
|
||||
Hash newHashAllowEmpty(std::string hashStr, HashType ht);
|
||||
|
||||
/* Print a hash in base-16 if it's MD5, or base-32 otherwise. */
|
||||
string printHash16or32(const Hash & hash);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue