Rev 84 | Rev 86 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 84 | Rev 85 | ||
---|---|---|---|
Line 838... | Line 838... | ||
838 | // Block 5 |
838 | // Block 5 |
839 | $signature = substr($uuid,20,12); |
839 | $signature = substr($uuid,20,12); |
840 | if (strtolower($signature) == '5ce32bd83b96') { |
840 | if (strtolower($signature) == '5ce32bd83b96') { |
841 | // HickelSOFT "SQL Server sortable UUID in C#" |
841 | // HickelSOFT "SQL Server sortable UUID in C#" |
842 | // Version 2: Resolution of 1 milliseconds, random part of 18 bits, UTC time, UUIDv8 conform. |
842 | // Version 2: Resolution of 1 milliseconds, random part of 18 bits, UTC time, UUIDv8 conform. |
843 | // Example: 2088dc33-000d-8045-87e8-4849434b454c |
843 | // Example: 2088dc33-000d-8045-87e8-5ce32bd83b96 |
844 | // Block 4 |
844 | // Block 4 |
845 | $rnd2bits = hexdec(substr($uuid,16,1)) & 0x3; |
845 | $rnd2bits = hexdec(substr($uuid,16,1)) & 0x3; |
846 | $year = hexdec(substr($uuid,17,3)); |
846 | $year = hexdec(substr($uuid,17,3)); |
847 | // Block 3 |
847 | // Block 3 |
848 | $dayOfYear = hexdec(substr($uuid,13,3)); // 1..366 |
848 | $dayOfYear = hexdec(substr($uuid,13,3)); // 1..366 |