2026-10-20 · 5 min read · Rahul Chitturi
- uuid
- fixtures
- debugging
The UUID page mints ids with crypto.randomUUID(). Every id is version 4. The count box decides how many lines to print, and a bad count is not reported as an error. An empty list means the count became NaN. A single unexpected id means the count was clamped.
The expression is Math.max(1, Math.min(100, Number(value))). Array.from then uses that length. Number() and the array length do not agree on fractions, and neither one rejects a letter.
Clamp numbers, and drop non-numbers
A blank box is Number("") which is 0, then the clamp raises it to 1. 0 and a negative such as -3 also print one id. 101 prints 100. 1e2 prints 100. Infinity prints 100. Spaces are ignored by Number, so " 3 " prints three ids.
20.9 survives the clamp as 20.9. Array.from then takes the integer length 20, so the page prints twenty lines. "abc" and "NaN" are NaN. Math.min(100, NaN) is NaN, and Math.max(1, NaN) is NaN. Array.from of a NaN length has length 0. The pre is empty, Copy still sits on the page, and there is no message saying the count is invalid.
- Read the count box before you read the list.
- Expect one id from a blank, 0, or a negative.
- Expect 100 ids from 101, 1e2, or Infinity.
- Expect no ids, and no error, from a letter.
Every edit mints a new batch
The list is memoized on the count value. Changing 2 to 20 throws away the previous ids and mints a new batch of twenty. Pasting the same count again does not restore the previous lines. Copy copies whatever is on screen, one id per line.
The version nibble is 4. This page does not mint a version 7 id, and it does not decode one. A production id whose third group starts with 7 came from another generator.
Use the batch as a fixture, then stop
Use the UUID tool for disposable version 4 fixtures, diff when you need to show that two batches differ, the JSON formatter when an id is buried in a payload, and the timestamp tool only for the twelve hex digits of a version 7 id you already have. Clear a letter out of the count box before you decide the generator returned nothing.