Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
getuniquepath.cpp
Go to the documentation of this file.
1#include <random.h>
2#include <util/fs.h>
3#include <util/strencodings.h>
4
7 fs::path tmpFile = base / HexStr(rnd.randbytes(8));
8 return tmpFile;
9}
Fast randomness source.
Definition random.h:156
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
Definition fs.h:30
fs::path GetUniquePath(const fs::path &base)
Helper function for getting a unique path.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.