34 static bool initialized =
false;
38 ::gettimeofday(&time, NULL);
41 ::srand(static_cast<unsigned int>((time.tv_sec * 100) + (time.tv_usec / 100)));
57 static const char text[] =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
58 std::vector<char> dst(size);
59 const size_t len = size - 1;
60 for (
size_t i = 0; i <= len; ++i )
62 dst[i] = text[::rand() % (
sizeof text - 1)];
64 return std::string(dst.begin(), dst.end());