Class UuidUtil

java.lang.Object
org.apache.logging.log4j.core.util.UuidUtil

public final class UuidUtil extends Object
Generates a unique ID. The generated UUID will be unique for approximately 8,925 years so long as less than 10,000 IDs are generated per millisecond on the same device (as identified by its MAC address).
  • Field Details

    • UUID_SEQUENCE

      public static final String UUID_SEQUENCE
      System property that may be used to seed the UUID generation with an integer value.
      See Also:
  • Method Details

    • getTimeBasedUuid

      public static UUID getTimeBasedUuid()
      Generates Type 1 UUID. The time contains the number of 100NS intervals that have occurred since 00:00:00.00 UTC, 10 October 1582. Each UUID on a particular machine is unique to the 100NS interval until they rollover around 3400 A.D.
      1. Digits 1-12 are the lower 48 bits of the number of 100 ns increments since the start of the UUID epoch.
      2. Digit 13 is the version (with a value of 1).
      3. Digits 14-16 are a sequence number that is incremented each time a UUID is generated.
      4. Digit 17 is the variant (with a value of binary 10) and 10 bits of the sequence number
      5. Digit 18 is final 16 bits of the sequence number.
      6. Digits 19-32 represent the system the application is running on.
      Returns:
      universally unique identifiers (UUID)