Random: Mark getRandom* const

Tá an tiomantas seo le fáil i:
Albert S. 2021-04-17 12:44:43 +02:00
tuismitheoir 4dc688f9eb
tiomantas ac56b2f61d
D'athraigh 2 comhad le 4 breiseanna agus 4 scriosta

Féach ar an gComhad

@ -29,7 +29,7 @@ Random::Random()
{
}
std::vector<char> Random::getRandom(unsigned int bytes)
std::vector<char> Random::getRandom(unsigned int bytes) const
{
auto buffer = std::make_unique<char[]>(bytes);
int r = getrandom(buffer.get(), bytes, GRND_NONBLOCK);
@ -46,7 +46,7 @@ std::vector<char> Random::getRandom(unsigned int bytes)
}
std::string Random::getRandomHexString(unsigned int bytes)
std::string Random::getRandomHexString(unsigned int bytes) const
{
std::stringstream stream;

Féach ar an gComhad

@ -22,8 +22,8 @@ class Random
{
public:
Random();
std::string getRandomHexString(unsigned int bytes);
std::vector<char> getRandom(unsigned int bytes);
std::string getRandomHexString(unsigned int bytes) const;
std::vector<char> getRandom(unsigned int bytes) const;
};
#endif // RANDOM_H