UUID v6 generator

The Randogram UUID generator produces a universally unique identifier of version 6.
A version 6 UUID carries the same fields as version 1, but its timestamp runs from the most significant bits down. Because of that the identifiers sort in ascending order as plain strings, and inserting them does not scatter rows across a database index. Version 6 is meant for systems that already hold version 1 identifiers; for new projects the standard suggests version 7.
You can also use the public UUID generator API

Questions and answers

How does version 6 differ from version 1?
The set of fields is the same, the order differs: in version 1 the timestamp starts with its low bits, in version 6 with its high bits. Because of that version 6 identifiers sort by time as plain strings, and version 1 identifiers do not.
Why does sorting by time matter?
It decides how new rows land in a database index. Ordered keys are appended to one edge of the tree, while random ones scatter across it, which forces pages to be loaded and split more often. On large tables the difference shows up in insert speed.
When should I pick version 7 over version 6?
Almost always, if the system is new. Version 6 is meant as a replacement for version 1 where such identifiers have already piled up: it keeps their fields, including the node address. Version 7 is simpler, stores ordinary Unix time and does not disclose the node.