mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
32 lines
739 B
C++
32 lines
739 B
C++
/*
|
|
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
|
* Copyright (C) 2008-2021 TrinityCore <http://www.trinitycore.org/>
|
|
*/
|
|
|
|
#ifndef AZEROTHCORE_CRYPTORANDOM_H
|
|
#define AZEROTHCORE_CRYPTORANDOM_H
|
|
|
|
#include "Define.h"
|
|
#include <array>
|
|
|
|
namespace Acore::Crypto
|
|
{
|
|
void GetRandomBytes(uint8* buf, size_t len);
|
|
|
|
template <typename Container>
|
|
void GetRandomBytes(Container& c)
|
|
{
|
|
GetRandomBytes(std::data(c), std::size(c));
|
|
}
|
|
|
|
template <size_t S>
|
|
std::array<uint8, S> GetRandomBytes()
|
|
{
|
|
std::array<uint8, S> arr;
|
|
GetRandomBytes(arr);
|
|
return arr;
|
|
}
|
|
}
|
|
|
|
#endif
|