diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-07-16 17:28:52 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-07-16 17:28:52 +0000 |
commit | cc0d77f8c9c71f5870bcaf3d0c041b6ba4c1bf63 (patch) | |
tree | 1776c2a44d9e32a6842f310c38f362bf59bb1ffb /src/libutil/hash.hh | |
parent | c466cb2091b7a382aba1739c0320f2b6c0a04c1e (diff) | |
parent | 5ea817dace2b554e602d7f9df6e43084ad112e3d (diff) |
Merge branch 'hash-always-has-type' of github.com:obsidiansystems/nix into better-ca-parse-errors
Diffstat (limited to 'src/libutil/hash.hh')
-rw-r--r-- | src/libutil/hash.hh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libutil/hash.hh b/src/libutil/hash.hh index af11a028d..026e80e71 100644 --- a/src/libutil/hash.hh +++ b/src/libutil/hash.hh @@ -18,6 +18,8 @@ const int sha1HashSize = 20; const int sha256HashSize = 32; const int sha512HashSize = 64; +extern std::set<std::string> hashTypes; + extern const string base32Chars; enum Base : int { Base64, Base32, Base16, SRI }; @@ -124,6 +126,7 @@ Hash compressHash(const Hash & hash, unsigned int newSize); /* Parse a string representing a hash type. */ HashType parseHashType(std::string_view s); + /* Will return nothing on parse error */ std::optional<HashType> parseHashTypeOpt(std::string_view s); |