2.4 Generation
GUIDs generated by Peios MUST be version 4 (random) as defined in RFC 4122 §4.4.
2.4.1 Algorithm #
To generate a version 4 GUID:
- Fill all 16 bytes with cryptographically random data.
- Set the four most significant bits of Data3 to
0100(version 4). - Set the two most significant bits of Data4[0] to
10(RFC 4122 variant).
The resulting GUID has 122 random bits, 4 version bits, and 2 variant bits.
2.4.2 Randomness source #
The random data MUST be obtained from a cryptographically secure source.
In the kernel, this MUST be get_random_bytes() or equivalent.
In userspace, this MUST be getrandom(2) with no flags (blocking
until the entropy pool is initialised) or equivalent.
GUIDs MUST NOT be generated using a pseudorandom number generator seeded from a predictable source.