MCPcopy Create free account
hub / github.com/apache/arrow / MakeRandomName

Function MakeRandomName

cpp/src/arrow/util/io_util.cc:1936–1949  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1934}
1935
1936std::string MakeRandomName(int num_chars) {
1937 constexpr std::string_view chars = "0123456789abcdefghijklmnopqrstuvwxyz";
1938
1939 std::default_random_engine gen(
1940 static_cast<std::default_random_engine::result_type>(GetRandomSeed()));
1941 std::uniform_int_distribution<int> dist(0, static_cast<int>(chars.length() - 1));
1942
1943 std::string s;
1944 s.reserve(num_chars);
1945 for (int i = 0; i < num_chars; ++i) {
1946 s += chars[dist(gen)];
1947 }
1948 return s;
1949}
1950
1951} // namespace
1952

Callers 1

MakeMethod · 0.85

Calls 3

GetRandomSeedFunction · 0.85
lengthMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected