MCPcopy Create free account
hub / github.com/apple/foundationdb / randomString

Function randomString

fdbserver/VersionedBTree.actor.cpp:8051–8058  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8049}
8050
8051StringRef randomString(Arena& arena, int len, char firstChar = 'a', char lastChar = 'z') {
8052 ++lastChar;
8053 StringRef s = makeString(len, arena);
8054 for (int i = 0; i < len; ++i) {
8055 *(uint8_t*)(s.begin() + i) = (uint8_t)deterministicRandom()->randomInt(firstChar, lastChar);
8056 }
8057 return s;
8058}
8059
8060Standalone<StringRef> randomString(int len, char firstChar = 'a', char lastChar = 'z') {
8061 Standalone<StringRef> s;

Callers 4

randomKVFunction · 0.70
Future<Void> randomSeeksFunction · 0.70
Future<Void> randomScansFunction · 0.70

Calls 4

makeStringFunction · 0.85
deterministicRandomFunction · 0.85
beginMethod · 0.45
randomIntMethod · 0.45

Tested by

no test coverage detected