MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / format_uuid_v1

Function format_uuid_v1

Engine/source/core/util/uuid.cpp:223–236  ·  view source on GitHub ↗

format_uuid_v1 -- make a UUID from the timestamp, clockseq, and node ID */

Source from the content-addressed store, hash-verified

221
222/* format_uuid_v1 -- make a UUID from the timestamp, clockseq, and node ID */
223static void format_uuid_v1(xuuid_t * uuid, unsigned16 clock_seq,
224 uuid_time_t timestamp, uuid_node_t node)
225{
226 /* Construct a version 1 uuid with the information we've gathered
227 * plus a few constants. */
228 uuid->time_low = (unsigned long)(timestamp & 0xFFFFFFFF);
229 uuid->time_mid = (unsigned short)((timestamp >> 32) & 0xFFFF);
230 uuid->time_hi_and_version = (unsigned short)((timestamp >> 48) & 0x0FFF);
231 uuid->time_hi_and_version |= (1 << 12);
232 uuid->clock_seq_low = clock_seq & 0xFF;
233 uuid->clock_seq_hi_and_reserved = (clock_seq & 0x3F00) >> 8;
234 uuid->clock_seq_hi_and_reserved |= 0x80;
235 memcpy(&uuid->node, &node, sizeof uuid->node);
236}
237
238/* get-current_time -- get time as 60 bit 100ns ticks since whenever.
239 Compensate for the fact that real clock resolution is less than 100ns. */

Callers 1

create_tokenFunction · 0.85

Calls 1

memcpyFunction · 0.85

Tested by

no test coverage detected