MCPcopy Create free account
hub / github.com/ElementsProject/elements / RandomString

Function RandomString

src/leveldb/util/testutil.cc:12–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10namespace test {
11
12Slice RandomString(Random* rnd, int len, std::string* dst) {
13 dst->resize(len);
14 for (int i = 0; i < len; i++) {
15 (*dst)[i] = static_cast<char>(' ' + rnd->Uniform(95)); // ' ' .. '~'
16 }
17 return Slice(*dst);
18}
19
20std::string RandomKey(Random* rnd, int len) {
21 // Make sure to generate a wide variety of characters so we

Callers 2

CompressibleStringFunction · 0.70
TESTFunction · 0.70

Calls 3

UniformMethod · 0.80
SliceClass · 0.70
resizeMethod · 0.45

Tested by

no test coverage detected