9 #ifndef ReportServiceCore_GUIDHelper_h 10 #define ReportServiceCore_GUIDHelper_h 24 const char lcHexDigits[16] =
26 '0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
27 '8',
'9',
'A',
'B',
'C',
'D',
'E',
'F' 31 for(
int i = (
sizeof(T)*2-1); i >= 0; --i, iT >>= 4)
33 ipString[i] = lcHexDigits[iT & 0x0000000F];
53 short ALPHA_CHAR_CODES[] = {48, 49, 50, 51, 52, 53, 54,
54 55, 56, 57, 65, 66, 67, 68, 69, 70};
63 for (i = 0; i < 8; i++)
65 uid.push_back(ALPHA_CHAR_CODES[rand()%16]);
68 for (i = 0; i < 3; i++)
70 for (j = 0; j < 4; j++)
72 uid.push_back(ALPHA_CHAR_CODES[rand()%16]);
76 double lTime = time(
NULL)*1000;
79 const unsigned int* pc =
reinterpret_cast<const unsigned int*
>(&lTime);
80 TToHexString<unsigned int>(*pc, lIDString);
81 TToHexString<unsigned int>(*(pc + 1), lIDString + 8);
82 TToHexString<unsigned int>(*(pc + 2), lIDString + 16);
83 TToHexString<unsigned int>(*(pc + 3), lIDString + 24);
94 std::string lTemp =
"0000000";
96 std::string timeString = lTemp.substr(lTemp.size() - 8);
98 for (i = 0; i < 8; i++)
100 uid.push_back(timeString[i]);
103 for (i = 0; i < 4; i++)
105 uid.push_back(ALPHA_CHAR_CODES[rand()%16]);
void TToHexString(T iT, char *ipString)
Definition: ManipulationHelper.h:22
static bool ConvertFromStringToGUID(std::string iString, GUID &pGUID)
GUID createUID()
Definition: ManipulationHelper.h:50
#define NULL
Definition: Null.h:10
Definition: ManipulationHelper.h:16
Definition: Base/Base/GUID.h:32