1
0
Fork 0
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:
Matthew Bauer 2020-06-12 10:09:42 -05:00
parent 19aa892f20
commit b260c9ee03
6 changed files with 24 additions and 38 deletions

View file

@ -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);