aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/hash.hh
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-07-16 14:58:53 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-07-16 14:58:53 +0000
commit5ea817dace2b554e602d7f9df6e43084ad112e3d (patch)
tree409213f4980018df204fe45afaf115f420a72907 /src/libutil/hash.hh
parentd0905623488ca97feeb28ebd9817af6270a53c48 (diff)
parent8807ff902e1b543410a9572cc146efa6c90dec87 (diff)
Merge remote-tracking branch 'upstream/master' into hash-always-has-type
Diffstat (limited to 'src/libutil/hash.hh')
-rw-r--r--src/libutil/hash.hh3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libutil/hash.hh b/src/libutil/hash.hh
index a55295912..98ee1bed0 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 };
@@ -119,6 +121,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);