-
-
Save anonymous/95c1ed54738f155fe977 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void OID::init() { | |
static AtomicUInt inc = static_cast<unsigned>( | |
scoped_ptr<SecureRandom>(SecureRandom::create())->nextInt64()); | |
{ | |
unsigned t = (unsigned) time(0); | |
unsigned char *T = (unsigned char *) &t; | |
_time[0] = T[3]; // big endian order because we use memcmp() to compare OID's | |
_time[1] = T[2]; | |
_time[2] = T[1]; | |
_time[3] = T[0]; | |
} | |
_machineAndPid = ourMachineAndPid; | |
{ | |
int new_inc = inc++; | |
unsigned char *T = (unsigned char *) &new_inc; | |
_inc[0] = T[2]; | |
_inc[1] = T[1]; | |
_inc[2] = T[0]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment