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

Function true_random

Engine/source/core/util/uuid.cpp:274–283  ·  view source on GitHub ↗

true_random -- generate a crypto-quality random number. This sample doesn't do that. */

Source from the content-addressed store, hash-verified

272/* true_random -- generate a crypto-quality random number.
273 This sample doesn't do that. */
274static unsigned16 true_random(void)
275{
276 uuid_time_t time_now;
277
278 get_system_time(&time_now);
279 time_now = time_now/UUIDS_PER_TICK;
280 srand((unsigned int)(((time_now >> 32) ^ time_now)&0xffffffff));
281
282 return rand();
283}
284
285/* This sample implementation generates a random node ID *
286 * in lieu of a system dependent call to get IEEE node ID. */

Callers 1

create_uuid_stateFunction · 0.85

Calls 1

get_system_timeFunction · 0.85

Tested by

no test coverage detected