mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-14 15:56:48 +03:00
692175901d
The 6 bytes obtained from `random_bytes()` is a 48-bit integer, which cannot be converted to decimal on a 32-bit system, without being implicitly cast to a float by PHP. This was causing problems with setting the multicast bit, and it led to non-random node values. This new approach splits the 6 bytes up into two 3-byte values, each a 24-bit integer, and applies the multicast bit to the most significant bits before re-combining the bytes as a string.