mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-02 02:48:51 -05:00
Split module-utils into smaller components for better dependency management. Fix many dependencies throughout the project. Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
21 lines
657 B
C++
21 lines
657 B
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include <algorithm>
|
|
#include "RandomStringGenerator.hpp"
|
|
|
|
std::string RandomStringGenerator::getRandomString()
|
|
{
|
|
const size_t length = lengthDist(rng);
|
|
std::string str(length, 0);
|
|
std::generate_n(str.begin(), length, [this]() { return charSet[charDist(rng)]; });
|
|
return str;
|
|
}
|
|
|
|
std::vector<std::string> RandomStringGenerator::createRandomStringVector(size_t size)
|
|
{
|
|
std::vector<std::string> vec(size);
|
|
std::generate_n(vec.begin(), size, [this]() { return getRandomString(); });
|
|
return vec;
|
|
}
|