Buckets:

soixantesept's picture
download
raw
438 Bytes
#include "Random.hpp"
#include "Hash.hpp"
Random::Random() {
_state = 0;
}
// This pseudo random number generator is a
// Mixed Congruential Generator with a period of 2^64
// https://en.wikipedia.org/wiki/Linear_congruential_generator
uint32_t Random::operator()(int numberOfBits) {
assert(numberOfBits > 0 && numberOfBits <= 32);
_state = (_state + 1) * PHI64;
return static_cast<uint32_t>(_state >> (64 - numberOfBits));
}

Xet Storage Details

Size:
438 Bytes
·
Xet hash:
2767f3034ab89b5527f9a6c9f22d3c8438dc673af9e5ee966c75de5430f22406

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.