29 #ifndef GPGFRONTEND_PASSPHRASEGENERATOR_H
30 #define GPGFRONTEND_PASSPHRASEGENERATOR_H
32 #include "core/GpgFrontendCore.h"
33 #include "core/GpgFunctionObject.h"
61 std::uniform_int_distribution<int> dist(999, 99999);
63 auto file_string = boost::format(
"KeyPackage_%1%") % dist(mt_);
64 static const char alphanum[] =
66 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
67 "abcdefghijklmnopqrstuvwxyz";
71 for (
int i = 0; i < len; ++i) {
72 tmp_str += alphanum[dist(mt_) % (
sizeof(alphanum) - 1)];
77 std::random_device
rd_;
78 std::mt19937 mt_ = std::mt19937(rd_());
The PassphraseGenerator class.
Definition: PassphraseGenerator.h:43
std::random_device rd_
Random device.
Definition: PassphraseGenerator.h:77
std::string Generate(int len)
generate passphrase
Definition: PassphraseGenerator.h:60
PassphraseGenerator(int channel=SingletonFunctionObject::GetDefaultChannel())
PassphraseGenerator constructor.
Definition: PassphraseGenerator.h:50
Definition: GpgFunctionObject.h:148
static int GetDefaultChannel()
Get the Default Channel object.
Definition: GpgFunctionObject.h:232
Definition: CoreCommonUtil.cpp:29