mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
verify blinding key for encrypted LS2
This commit is contained in:
parent
24c5ed1cff
commit
557244bc3f
5 changed files with 42 additions and 14 deletions
|
@ -1,3 +1,5 @@
|
|||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include <chrono>
|
||||
|
@ -37,7 +39,6 @@ namespace util
|
|||
std::chrono::system_clock::now().time_since_epoch()).count ();
|
||||
}
|
||||
|
||||
|
||||
static int64_t g_TimeOffset = 0; // in seconds
|
||||
|
||||
static void SyncTimeWithNTP (const std::string& address)
|
||||
|
@ -178,6 +179,19 @@ namespace util
|
|||
{
|
||||
return GetLocalSecondsSinceEpoch () + g_TimeOffset;
|
||||
}
|
||||
|
||||
void GetCurrentDate (char * date)
|
||||
{
|
||||
time_t t = time (nullptr);
|
||||
struct tm tm;
|
||||
#ifdef _WIN32
|
||||
gmtime_s(&tm, &t);
|
||||
sprintf_s(date, 9, "%04i%02i%02i", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
|
||||
#else
|
||||
gmtime_r(&t, &tm);
|
||||
sprintf(date, "%04i%02i%02i", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue