util: add current_time()
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
934c658fde
commit
16da8fb3cf
6
util.h
6
util.h
|
@ -4,6 +4,7 @@
|
|||
#include <cryptopp/filters.h>
|
||||
#include <cryptopp/hex.h>
|
||||
#include <cryptopp/sha3.h>
|
||||
#include <chrono>
|
||||
#include <cstddef>
|
||||
|
||||
namespace fortuna {
|
||||
|
@ -28,6 +29,11 @@ static auto do_sha(const std::string& str_to_hash) -> const std::string {
|
|||
return digest;
|
||||
}
|
||||
|
||||
static auto current_time() -> std::chrono::time_point<std::chrono::system_clock,
|
||||
std::chrono::duration<long, std::ratio<1, 1000000000>>> {
|
||||
return std::chrono::system_clock::now();
|
||||
}
|
||||
|
||||
Util() = delete;
|
||||
~Util() noexcept;
|
||||
|
||||
|
|
Reference in New Issue