Changeset 3057 for pjproject/trunk/pjlib/src/pj/guid_simple.c
- Timestamp:
- Jan 13, 2010 1:09:45 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/guid_simple.c
r2394 r3057 68 68 69 69 for (p=str->ptr, end=p+PJ_GUID_STRING_LENGTH; p<end; ) { 70 /* Assumes rand() only has 16bit randomness */ 71 unsigned short val = pj_rand(); 72 *p++ = guid_chars[(val >> 8) & 63]; 73 *p++ = guid_chars[(val & 0xFF) & 63]; 70 pj_uint32_t rand_val = pj_rand(); 71 pj_uint32_t rand_idx = RAND_MAX; 72 73 for ( ; rand_idx>0 && p<end; rand_idx>>=8, rand_val>>=8, p++) { 74 *p = guid_chars[(rand_val & 0xFF) & 63]; 75 } 74 76 } 75 77
Note: See TracChangeset
for help on using the changeset viewer.