Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
CryptoRandom.h
Go to the documentation of this file.
1
/*
2
* This file is part of Project SkyFire https://www.projectskyfire.org.
3
* See LICENSE.md file for Copyright information
4
*/
5
6
#ifndef _CRYPTORANDOM_H
7
#define _CRYPTORANDOM_H
8
9
#include "
Define.h
"
10
#include <array>
11
12
namespace
SkyFire::Crypto
13
{
14
void
GetRandomBytes
(
uint8
* buf,
size_t
len);
15
16
template
<
typename
Container>
17
void
GetRandomBytes
(Container& c)
18
{
19
GetRandomBytes
(std::data(c), std::size(c));
20
}
21
22
template
<
size_t
S>
23
std::array<uint8, S>
GetRandomBytes
()
24
{
25
std::array<uint8, S> arr;
26
GetRandomBytes
(arr);
27
return
arr;
28
}
29
}
30
31
#endif
Define.h
uint8
std::uint8_t uint8
Definition
Define.h:79
SkyFire::Crypto
Definition
ARC4.h:15
SkyFire::Crypto::GetRandomBytes
std::array< uint8, S > GetRandomBytes()
Definition
CryptoRandom.h:23
src
server
shared
Cryptography
CryptoRandom.h
Generated on
for Project SkyFire Core by
1.17.0