Rev 69 | Rev 71 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 69 | Rev 70 | ||
---|---|---|---|
Line 76... | Line 76... | ||
76 | </script> |
76 | </script> |
77 | <p><a id="uuidv7_info_button" href="javascript:show_uuidv7_info()">Show format</a> |
77 | <p><a id="uuidv7_info_button" href="javascript:show_uuidv7_info()">Show format</a> |
78 | <pre id="uuidv7_info" style="display:none">Variant 1, Version 7 UUID: |
78 | <pre id="uuidv7_info" style="display:none">Variant 1, Version 7 UUID: |
79 | - 48 bit <abbr title="Count of 1ms intervals passed since 1 Jan 1970 00:00:00 GMT">Unix Time in milliseconds</abbr> |
79 | - 48 bit <abbr title="Count of 1ms intervals passed since 1 Jan 1970 00:00:00 GMT">Unix Time in milliseconds</abbr> |
80 | - 4 bit Version (fix 0x7) |
80 | - 4 bit Version (fix 0x7) |
81 | - 12 bit Random |
81 | - 12 bit Data |
82 | - 2 bit Variant (fix 0b10) |
82 | - 2 bit Variant (fix 0b10) |
83 | - 62 bit Random</pre></p> |
83 | - 62 bit Data |
- | 84 | ||
- | 85 | Structure of data (74 bits): |
|
- | 86 | - OPTIONAL : Sub-millisecond timestamp fraction (0-12 bits) |
|
- | 87 | - OPTIONAL : Carefully seeded counter |
|
- | 88 | - Random generated bits for any remaining space |
|
- | 89 | ||
- | 90 | Time resolution for various sub-millisecond bits: |
|
- | 91 | <?php |
|
- | 92 | for ($num_ms_frac_bits=0; $num_ms_frac_bits<=12; $num_ms_frac_bits++) { |
|
- | 93 | $resolution_ns = 1000000 / pow(2,$num_ms_frac_bits); |
|
- | 94 | if ($resolution_ns >= 1000000) $resolution_ns_hf = ($resolution_ns/1000000)." ms"; |
|
- | 95 | else if ($resolution_ns >= 1000) $resolution_ns_hf = ($resolution_ns/1000)." µs"; |
|
- | 96 | else $resolution_ns_hf = "$resolution_ns ns"; |
|
- | 97 | echo "$num_ms_frac_bits bits fraction = $resolution_ns_hf\n"; |
|
- | 98 | } |
|
- | 99 | ?> |
|
- | 100 | ||
- | 101 | </pre></p> |
|
84 | 102 | ||
85 | <?php |
103 | <?php |
86 | if (AUTO_NEW_UUIDS > 0) { /** @phpstan-ignore-line */ |
104 | if (AUTO_NEW_UUIDS > 0) { /** @phpstan-ignore-line */ |
87 | echo '<p>Here are '.AUTO_NEW_UUIDS.' UUIDs that were created just for you! (Reload the page to get more)</p>'; |
105 | echo '<p>Here are '.AUTO_NEW_UUIDS.' UUIDs that were created just for you! (Reload the page to get more)</p>'; |
88 | 106 | ||
89 | echo '<pre>'; |
107 | echo '<pre>'; |
90 | for ($i=0; $i<10; $i++) { |
108 | for ($i=0; $i<AUTO_NEW_UUIDS; $i++) { |
91 | $uuid = gen_uuid_v7(); |
109 | $uuid = gen_uuid_v7(); |
92 | echo '<a href="interprete_uuid.php?uuid='.$uuid.'">'.$uuid.'</a><br>'; |
110 | echo '<a href="interprete_uuid.php?uuid='.$uuid.'">'.$uuid.'</a><br>'; |
93 | } |
111 | } |
94 | echo '</pre>'; |
112 | echo '</pre>'; |
95 | } |
113 | } |
Line 125... | Line 143... | ||
125 | <?php |
143 | <?php |
126 | if (AUTO_NEW_UUIDS > 0) { /** @phpstan-ignore-line */ |
144 | if (AUTO_NEW_UUIDS > 0) { /** @phpstan-ignore-line */ |
127 | echo '<p>Here are '.AUTO_NEW_UUIDS.' UUIDs that were created just for you! (Reload the page to get more)</p>'; |
145 | echo '<p>Here are '.AUTO_NEW_UUIDS.' UUIDs that were created just for you! (Reload the page to get more)</p>'; |
128 | 146 | ||
129 | echo '<pre>'; |
147 | echo '<pre>'; |
130 | for ($i=0; $i<10; $i++) { |
148 | for ($i=0; $i<AUTO_NEW_UUIDS; $i++) { |
131 | $uuid = gen_uuid_v6(); |
149 | $uuid = gen_uuid_v6(); |
132 | echo '<a href="interprete_uuid.php?uuid='.$uuid.'">'.$uuid.'</a><br>'; |
150 | echo '<a href="interprete_uuid.php?uuid='.$uuid.'">'.$uuid.'</a><br>'; |
133 | } |
151 | } |
134 | echo '</pre>'; |
152 | echo '</pre>'; |
135 | } |
153 | } |
Line 161... | Line 179... | ||
161 | <?php |
179 | <?php |
162 | if (AUTO_NEW_UUIDS > 0) { /** @phpstan-ignore-line */ |
180 | if (AUTO_NEW_UUIDS > 0) { /** @phpstan-ignore-line */ |
163 | echo '<p>Here are '.AUTO_NEW_UUIDS.' UUIDs that were created just for you! (Reload the page to get more)</p>'; |
181 | echo '<p>Here are '.AUTO_NEW_UUIDS.' UUIDs that were created just for you! (Reload the page to get more)</p>'; |
164 | 182 | ||
165 | echo '<pre>'; |
183 | echo '<pre>'; |
166 | for ($i=0; $i<10; $i++) { |
184 | for ($i=0; $i<AUTO_NEW_UUIDS; $i++) { |
167 | $uuid = gen_uuid_v4(); |
185 | $uuid = gen_uuid_v4(); |
168 | echo '<a href="interprete_uuid.php?uuid='.$uuid.'">'.$uuid.'</a><br>'; |
186 | echo '<a href="interprete_uuid.php?uuid='.$uuid.'">'.$uuid.'</a><br>'; |
169 | } |
187 | } |
170 | echo '</pre>'; |
188 | echo '</pre>'; |
171 | } |
189 | } |
Line 201... | Line 219... | ||
201 | <?php |
219 | <?php |
202 | if (AUTO_NEW_UUIDS > 0) { /** @phpstan-ignore-line */ |
220 | if (AUTO_NEW_UUIDS > 0) { /** @phpstan-ignore-line */ |
203 | echo '<p>Here are '.AUTO_NEW_UUIDS.' UUIDs that were created just for you! (Reload the page to get more)</p>'; |
221 | echo '<p>Here are '.AUTO_NEW_UUIDS.' UUIDs that were created just for you! (Reload the page to get more)</p>'; |
204 | 222 | ||
205 | echo '<pre>'; |
223 | echo '<pre>'; |
206 | for ($i=0; $i<10; $i++) { |
224 | for ($i=0; $i<AUTO_NEW_UUIDS; $i++) { |
207 | $uuid = gen_uuid_v1(); |
225 | $uuid = gen_uuid_v1(); |
208 | echo '<a href="interprete_uuid.php?uuid='.$uuid.'">'.$uuid.'</a><br>'; |
226 | echo '<a href="interprete_uuid.php?uuid='.$uuid.'">'.$uuid.'</a><br>'; |
209 | } |
227 | } |
210 | echo '</pre>'; |
228 | echo '</pre>'; |
211 | } |
229 | } |