mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 03:12:43 +00:00
18 lines
360 B
C++
18 lines
360 B
C++
|
#include <Common/getRandomASCIIString.h>
|
||
|
#include <Common/thread_local_rng.h>
|
||
|
#include <random>
|
||
|
|
||
|
namespace DB
|
||
|
{
|
||
|
|
||
|
String getRandomASCIIString(size_t len, char first, char last)
|
||
|
{
|
||
|
std::uniform_int_distribution<int> distribution(first, last);
|
||
|
String res(len, ' ');
|
||
|
for (auto & c : res)
|
||
|
c = distribution(thread_local_rng);
|
||
|
return res;
|
||
|
}
|
||
|
|
||
|
}
|