MCPcopy Create free account
hub / github.com/catboost/catboost / GenerateRandomString

Function GenerateRandomString

library/cpp/streams/brotli/brotli_ut.cpp:31–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 }
30
31 TString GenerateRandomString(size_t size) {
32 TReallyFastRng32 rng(42);
33 TString result;
34 result.reserve(size + sizeof(ui64));
35 while (result.size() < size) {
36 ui64 value = rng.GenRand64();
37 result += TStringBuf(reinterpret_cast<const char*>(&value), sizeof(value));
38 }
39 result.resize(size);
40 return result;
41 }
42
43 Y_UNIT_TEST(TestHelloWorld) {
44 TestCase("hello world");

Callers 1

Y_UNIT_TESTFunction · 0.85

Calls 4

GenRand64Method · 0.80
reserveMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected