util: add current_time()
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-01-01 09:01:25 +01:00
parent 934c658fde
commit 16da8fb3cf
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

6
util.h
View File

@ -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;