Class UUIDs

java.lang.Object
com.seeq.utilities.UUIDs

public class UUIDs extends Object
Collection of methods for interacting with and generating UUIDs
  • Field Details

    • ID_PATTERN

      public static final Pattern ID_PATTERN
  • Constructor Details

    • UUIDs

      public UUIDs()
  • Method Details

    • randomBase64Guid

      public static String randomBase64Guid()
      Generates a random base64 guid
      Returns:
      the random base64 guid
    • timeOrderedUUID

      public static UUID timeOrderedUUID()
      Generates a time ordered UUID, also known as UUID v6. This type of UUID is well-suited for database primary keys, since it starts with a monotonically increasing timestamp.

      Our implementation makes the least significant bits completely random, since we have no use for a node identifier or clock sequence, and we have some code that depends on the LSB being random. This also means that we don't need to block when two entries have the same millisecond timestamp, as the randomness will distinguish them.

      See Peabody for more information.

    • fromConcatenatedUUIDs

      public static UUID fromConcatenatedUUIDs(UUID uuid1, UUID uuid2)
      Generates a UUID from a concatenation of two other UUIDs.