35 int time_hi_and_version;
36 int clock_seq_hi_and_rsv;
42 uuid.time_low = GetRandomNumber(
45 uuid.time_mid = GetRandomNumber(0, 65535);
46 uuid.time_hi_and_version = GetRandomNumber(0, 65535);
47 uuid.clock_seq_hi_and_rsv = GetRandomNumber(0, 255);
48 uuid.clock_seq_low = GetRandomNumber(0, 255);
49 uuid.node_hi = GetRandomNumber(0, 65535);
50 uuid.node_low = GetRandomNumber(0, 2147483647);
54 uuid.clock_seq_hi_and_rsv = (uuid.clock_seq_hi_and_rsv & 0x3F) | 0x80;
58 uuid.time_hi_and_version = (uuid.time_hi_and_version & 0x0fff) | 0x4000;
60 str.Printf(
"%08x-%04x-%04x-%02x%02x-%04x%08x", uuid.time_low, uuid.time_mid,
61 uuid.time_hi_and_version, uuid.clock_seq_hi_and_rsv,
62 uuid.clock_seq_low, uuid.node_hi, uuid.node_low);