Class UlidConverter


  • public class UlidConverter
    extends Object
    • Method Detail

      • toString

        public static String toString​(UUID uuid)
        Convert a UUID to ULID string The returning string is encoded to Crockford's base32. The timestamp and random components are encoded separated.
        Parameters:
        uuid - a UUID
        Returns:
        a ULID
      • fromString

        public static UUID fromString​(String ulid)
        Converts a ULID string to a UUID. The input string must be encoded to Crockford's base32, following the ULID specification. The timestamp and random components are decoded separated. An exception is thrown if the ULID string is invalid.
        Parameters:
        ulid - a ULID
        Returns:
        a UUID if valid