27 #pragma warning(disable:4267) // '?' : conversion from 'A' to 'B', possible loss of data
32 uint32_t
adler32(
const uint8_t *buffer,
size_t size) {
33 size_t a = 1, b = 0, tlen;
35 tlen = size > 5552 ? 5552 : size;
50 static std::random_device rd;
51 static std::mt19937 gen(rd());
52 static std::uniform_int_distribution<long> dis(0, 2147483647);
53 return min + (dis(gen) % (max - min + 1));
58 static std::random_device rd;
59 static std::mt19937 gen(rd());
60 static std::uniform_real_distribution<float> dis(0.0, 1.0);
61 return min + (max - min)*dis(gen);
66 return (r > 0.0) ? floor(r + 0.5) : ceil(r - 0.5);