From 3c57efe5b68116147b616eb66a4934b2364314e3 Mon Sep 17 00:00:00 2001 From: antao Date: Wed, 17 Oct 2018 19:45:17 +0800 Subject: [PATCH] Delete an unused function --- lib/inc/drogon/utils/Utilities.h | 2 +- lib/src/Utilities.cc | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/inc/drogon/utils/Utilities.h b/lib/inc/drogon/utils/Utilities.h index 8b81760e..9d192d2a 100755 --- a/lib/inc/drogon/utils/Utilities.h +++ b/lib/inc/drogon/utils/Utilities.h @@ -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 splitString(const std::string &str, const std::string &separator); std::string getuuid(); diff --git a/lib/src/Utilities.cc b/lib/src/Utilities.cc index c7ae5559..6da18fed 100755 --- a/lib/src/Utilities.cc +++ b/lib/src/Utilities.cc @@ -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)); - std::string char_space = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; +// timespec tp; +// clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tp); +// //LOG_INFO<<"time: "<(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) {