* Pass HashType values instead of strings.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user