MCPcopy Create free account
hub / github.com/ddnet/ddnet / RandomUuid

Function RandomUuid

src/engine/shared/uuid_manager.cpp:19–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
18
19CUuid RandomUuid()
20{
21 CUuid Result;
22 secure_random_fill(&Result, sizeof(Result));
23
24 // set version 4 (UUID is randomly generated)
25 Result.m_aData[6] &= 0x0f;
26 Result.m_aData[6] |= 0x40;
27
28 // set variant 1 (RFC 4122)
29 Result.m_aData[8] &= 0x3f;
30 Result.m_aData[8] |= 0x80;
31
32 return Result;
33}
34
35CUuid CalculateUuid(const char *pName)
36{

Callers 6

OnInitMethod · 0.85
SaveTeamScoreMethod · 0.85
SaveTeamMethod · 0.85
ConnectMethod · 0.85
UpdateMethod · 0.85
CRegisterClass · 0.85

Calls 1

secure_random_fillFunction · 0.85

Tested by

no test coverage detected