aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/hash.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-07-16 17:28:52 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-07-16 17:28:52 +0000
commitcc0d77f8c9c71f5870bcaf3d0c041b6ba4c1bf63 (patch)
tree1776c2a44d9e32a6842f310c38f362bf59bb1ffb /src/libutil/hash.cc
parentc466cb2091b7a382aba1739c0320f2b6c0a04c1e (diff)
parent5ea817dace2b554e602d7f9df6e43084ad112e3d (diff)
Merge branch 'hash-always-has-type' of github.com:obsidiansystems/nix into better-ca-parse-errors
Diffstat (limited to 'src/libutil/hash.cc')
-rw-r--r--src/libutil/hash.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc
index 4b82f191e..c7ccb809d 100644
--- a/src/libutil/hash.cc
+++ b/src/libutil/hash.cc
@@ -9,7 +9,6 @@
#include "archive.hh"
#include "parser.hh"
#include "util.hh"
-#include "istringstream_nocopy.hh"
#include <sys/types.h>
#include <sys/stat.h>
@@ -17,6 +16,7 @@
namespace nix {
+
static size_t regularHashSize(HashType type) {
switch (type) {
case htMD5: return md5HashSize;
@@ -27,6 +27,10 @@ static size_t regularHashSize(HashType type) {
abort();
}
+
+std::set<std::string> hashTypes = { "md5", "sha1", "sha256", "sha512" };
+
+
Hash::Hash(HashType type) : type(type)
{
hashSize = regularHashSize(type);