mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-16 16:56:07 +00:00
feat(Core/DB/Authserver): remove sha_pass_hash (#4827)
This commit is contained in:
31
src/common/Cryptography/CryptoRandom.h
Normal file
31
src/common/Cryptography/CryptoRandom.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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
|
||||
Reference in New Issue
Block a user