1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-22 02:09:36 +01:00
nix/tests/unit/libutil-support/tests/hash.cc

20 lines
334 B
C++

#include <regex>
#include <rapidcheck.h>
#include "hash.hh"
#include "tests/hash.hh"
namespace rc {
using namespace nix;
Gen<Hash> Arbitrary<Hash>::arbitrary()
{
Hash hash(HashAlgorithm::SHA1);
for (size_t i = 0; i < hash.hashSize; ++i)
hash.hash[i] = *gen::arbitrary<uint8_t>();
return gen::just(hash);
}
}