library/src/utility/BP-StringUtilities.cc
// Generates a random uuid.  This is purely random, not based on the GUID/UUID standard
// which relies on various pieces of system data.  The reason for this is that the UUID
// standard can leak information in UUIDs, so this aims to avoid that data leak.
Generates a random uuid.  This is purely random, not based on the GUID/UUID standard
which relies on various pieces of system data.  The reason for this is that the UUID
standard can leak information in UUIDs, so this aims to avoid that data leak.
Generates a random uuid . This is purely random not based on the GUID / UUID standard which relies on various pieces of system data . The reason for this is that the UUID standard can leak information in UUIDs so this aims to avoid that data leak .
char * BP_GenRandomUUID()
{
	char *random_uuid = (char *) bpcalloc(37, 1);
	unsigned char *random_data = BP_GenRandomUnsignedCharString(16);
	sprintf
	(
			random_uuid, "%.02x%.02x%.02x%.02x-%.02x%.02x-%.02x%.02x-%.02x%.02x-%.02x%.02x%.02x%.02x%.02x%.02x",
			random_data[0],
			random_data[1],
			random_data[2],
			random_data[3],
			random_data[4],
			random_data[5],
			random_data[6],
			random_data[7],
			random_data[8],
			random_data[9],
			random_data[10],
			random_data[11],
			random_data[12],
			random_data[13],
			random_data[14],
			random_data[15]
	);
	bpfree(random_data);
	return random_uuid;
}
char * BP_GenRandomUUID ( ) { char * random_uuid = ( char * ) bpcalloc ( 37 , 1 ) ; unsigned char * random_data = BP_GenRandomUnsignedCharString ( 16 ) ; sprintf ( random_uuid , " " , random_data [ 0 ] , random_data [ 1 ] , random_data [ 2 ] , random_data [ 3 ] , random_data [ 4 ] , random_data [ 5 ] , random_data [ 6 ] , random_data [ 7 ] , random_data [ 8 ] , random_data [ 9 ] , random_data [ 10 ] , random_data [ 11 ] , random_data [ 12 ] , random_data [ 13 ] , random_data [ 14 ] , random_data [ 15 ] ) ; bpfree ( random_data ) ; return random_uuid ; }
Generates a random uuid.
Generates a random uuid .
// create buffer first for uuid // generate 32 bytes of data // destroy the random data // return the random uuid value