> 16) & 0xFFFFFFFF; $time_low = $unixMs & 0xFFFF; $time_hi_and_version = ($time_low & 0x0FFF) | (0x7 << 12); $clock_seq_hi_and_reserved = ($sequence & 0x3FFF) | 0x8000; $randHex = bin2hex(random_bytes(6)); return sprintf( '%08x-%04x-%04x-%04x-%012s', $time_high, $time_low, $time_hi_and_version, $clock_seq_hi_and_reserved, $randHex ); } }