lokinet/test/test_util.cpp
dan 13b01c86a6 Updated RpcServer Initialization and Logic
-- Moved all RPCServer initialization logic to rpcserver constructor
    -- Fixed config logic, fxn binding to rpc address, fxn adding rpc cats
    -- router hive failed CI/CD resulting from outdated reference to rpcBindAddr
    -- ipc socket as default hidden from windows (for now)
refactored config endpoint
    - added rpc call script (contrib/omq-rpc.py)
    - added new fxns to .ini config stuff
    - added delete .ini file functionality to config endpoint
    - added edge case control for config endpoint

add commented out line in clang-form for header reorg later
2023-01-24 06:50:46 -08:00

34 lines
636 B
C++

#include "test_util.hpp"
#include <random>
namespace llarp
{
namespace test
{
std::string
randFilename()
{
static const char alphabet[] = "abcdefghijklmnopqrstuvwxyz";
std::random_device rd;
std::uniform_int_distribution< size_t > dist{0, sizeof(alphabet) - 2};
std::string filename;
for(size_t i = 0; i < 5; ++i)
{
filename.push_back(alphabet[dist(rd)]);
}
filename.push_back('.');
for(size_t i = 0; i < 5; ++i)
{
filename.push_back(alphabet[dist(rd)]);
}
return filename;
}
} // namespace test
} // namespace llarp