mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
Merge branch 'hash-always-has-type' of github.com:obsidiansystems/nix into better-ca-parse-errors
This commit is contained in:
commit
cc0d77f8c9
138 changed files with 8552 additions and 2192 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue