mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
* Pass HashType values instead of strings.
This commit is contained in:
parent
1307b22223
commit
ff762fb499
11 changed files with 36 additions and 23 deletions
|
@ -335,4 +335,13 @@ HashType parseHashType(const string & s)
|
|||
}
|
||||
|
||||
|
||||
string printHashType(HashType ht)
|
||||
{
|
||||
if (ht == htMD5) return "md5";
|
||||
else if (ht == htSHA1) return "sha1";
|
||||
else if (ht == htSHA256) return "sha256";
|
||||
else throw Error("cannot print unknown hash type");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -82,6 +82,9 @@ Hash compressHash(const Hash & hash, unsigned int newSize);
|
|||
/* Parse a string representing a hash type. */
|
||||
HashType parseHashType(const string & s);
|
||||
|
||||
/* And the reverse. */
|
||||
string printHashType(HashType ht);
|
||||
|
||||
|
||||
union Ctx;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue