Closed
Description
java.util.UUID#timestamp() only works for version 1 UUIDs.
It would be nice to have similar functionality for version 6 UUIDs.
E.g. a static method in TimeBasedReorderedGenerator, something along the lines of
public static long timestamp(UUID uuid)
{
assert(uuid.version()==6);
return ((uuid.getMostSignificantBits()>>>4) & ~0xFFF) | (uuid.getMostSignificantBits()&0xFFF);
}
Better yet, a static method in UUIDUtil that returns the number of millis since unix epoch for versions 1, 6 and 7 UUIDs.
thank you very much
Gabriel
Metadata
Metadata
Assignees
Labels
No labels