Delete an unused function

This commit is contained in:
antao 2018-10-17 19:45:17 +08:00
parent 8df7b9c69a
commit 3c57efe5b6
2 changed files with 16 additions and 16 deletions

View File

@ -22,7 +22,7 @@
namespace drogon
{
bool isInteger(const std::string &str);
std::string genRandomString(int length);
//std::string genRandomString(int length);
std::string stringToHex(unsigned char *ptr, long long length);
std::vector<std::string> splitString(const std::string &str, const std::string &separator);
std::string getuuid();

View File

@ -27,23 +27,23 @@ bool isInteger(const std::string &str)
}
return true;
}
std::string genRandomString(int length)
{
int i;
char str[length + 1];
// std::string genRandomString(int length)
// {
// int i;
// char str[length + 1];
timespec tp;
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tp);
//LOG_INFO<<"time: "<<tp.tv_nsec;
srand(static_cast<unsigned int>(tp.tv_nsec));
std::string char_space = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
// timespec tp;
// clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tp);
// //LOG_INFO<<"time: "<<tp.tv_nsec;
// srand(static_cast<unsigned int>(tp.tv_nsec));
// std::string char_space = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
for (i = 0; i < length; i++)
{
str[i] = char_space[rand() % char_space.length()];
}
return std::string(str);
}
// for (i = 0; i < length; i++)
// {
// str[i] = char_space[rand() % char_space.length()];
// }
// return std::string(str);
// }
std::string stringToHex(unsigned char *ptr, long long length)
{