MCPcopy Create free account
hub / github.com/facebook/CacheLib / generateRandomString

Function generateRandomString

cachelib/common/tests/HashTests.cpp:31–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29static std::mt19937 gen(folly::Random::rand32());
30
31std::string generateRandomString() {
32 static std::uniform_int_distribution<> genChar(0, 255);
33 std::string ret;
34 for (int i = 0; i < kMaxKeySize; i++) {
35 ret.push_back(static_cast<char>(genChar(gen)));
36 }
37 return ret;
38}
39
40TEST(Hash, Murmur2) {
41 int numTests = 10000;

Callers 1

TESTFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected