UUID Version 6 Generator

········-····-····-····-············

What a version 6 UUID is

A version 6 UUID contains the same fields as a version 1 UUID (timestamp, clock sequence, node ID) with the timestamp rearranged so that its most significant part comes first.

Why the reordering exists

Version 1 splits its timestamp into low, mid and high fields and stores them in that order, which was fine for uniqueness and useless for sorting: two UUIDs made a second apart compare in an order that has nothing to do with time. Version 6 moves the high bits to the front, and the values then sort chronologically both as strings and as bytes.

This makes version 6 the migration path for a system already storing version 1 UUIDs that has started to care about index locality. Every field a version 1 consumer knows is still there, in the same widths.

The node ID in a browser

As with version 1, a browser has no MAC address to offer, so the node ID here is random, with the multicast bit set. It is conformant, and it is not a hardware identity.

Version 6 or version 7

For a new system, prefer version 7: it is simpler, uses ordinary Unix milliseconds, and carries no node field. Choose version 6 when compatibility with the version 1 layout is the point.