MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / RandStr

Function RandStr

tensorflow/core/util/example_proto_fast_parsing_test.cc:324–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322}
323
324string RandStr(random::SimplePhilox* rng) {
325 static const char key_char_lookup[] =
326 "0123456789{}~`!@#$%^&*()"
327 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
328 "abcdefghijklmnopqrstuvwxyz";
329 auto len = 1 + rng->Rand32() % 200;
330 string str;
331 str.reserve(len);
332 while (len-- > 0) {
333 str.push_back(
334 key_char_lookup[rng->Rand32() % (sizeof(key_char_lookup) /
335 sizeof(key_char_lookup[0]))]);
336 }
337 return str;
338}
339
340void Fuzz(random::SimplePhilox* rng) {
341 // Generate keys.

Callers 1

FuzzFunction · 0.85

Calls 3

Rand32Method · 0.80
reserveMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected