mirror of
https://github.com/NixOS/nix.git
synced 2025-11-22 02:09:36 +01:00
20 lines
334 B
C++
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);
|
|
}
|
|
|
|
}
|