Bitcoin Core
22.0.0
P2P Digital Currency
src
util
getuniquepath.cpp
Go to the documentation of this file.
1
#include <
random.h
>
2
#include <
fs.h
>
3
#include <
util/strencodings.h
>
4
5
fs::path
GetUniquePath
(
const
fs::path& base)
6
{
7
FastRandomContext
rnd;
8
fs::path tmpFile = base /
HexStr
(rnd.
randbytes
(8));
9
return
tmpFile;
10
}
strencodings.h
fs.h
GetUniquePath
fs::path GetUniquePath(const fs::path &base)
Helper function for getting a unique path.
Definition:
getuniquepath.cpp:5
FastRandomContext
Fast randomness source.
Definition:
random.h:119
HexStr
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
Definition:
strencodings.cpp:594
random.h
FastRandomContext::randbytes
std::vector< unsigned char > randbytes(size_t len)
Generate random bytes.
Definition:
random.cpp:626
Generated on Thu Sep 9 2021 12:00:00 for Bitcoin Core by
1.8.14