#pragma once #include #include "types.hh" #include "serialise.hh" namespace nix { extern const string base32Chars; typedef enum { htUnknown = 0, htMD5 = GCRY_MD_MD5, htSHA1 = GCRY_MD_SHA1, htSHA256 = GCRY_MD_SHA256, htSHA512 = GCRY_MD_SHA512, htSHA3_256 = GCRY_MD_SHA3_256, htSHA3_512 = GCRY_MD_SHA3_512, htBLAKE2s_256 = GCRY_MD_BLAKE2S_256 } HashType; struct Hash { static const unsigned int maxHashSize = 64; unsigned int hashSize; unsigned char hash[maxHashSize]; HashType type; /* Create an unusable hash object. */ Hash(); /* Create a zero-filled hash object. */ Hash(HashType type); /* Check whether two hash are equal. */ bool operator == (const Hash & h2) const; /* Check whether two hash are not equal. */ bool operator != (const Hash & h2) const; /* For sorting. */ bool operator < (const Hash & h) const; }; /* Convert a hash to a hexadecimal representation. */ string printHash(const Hash & hash); /* Parse a hexadecimal
aboutsummaryrefslogtreecommitdiff
path: root/tests/challenge.scm
blob: 9c6d6e0d58f3783969d4ec3c8aa991375227f614 (about) (plain)
1
2
3
4
5
6
7</