Class ModId

java.lang.Object
io.ebean.redis.ModId

public final class ModId extends Object
Provides a modified base64 encoded UUID and shorter 12 character random unique value.

newId()

It produces a 22 character string that is a base64 encoded UUID with the + and / characters replaced with - and _ so as to be URL safe without requiring encoding.

newShortId()

It produces a 12 character string that base64 encoded random number (72 bit).

Note that this now internally uses java.util.Base64 to encode the values.

  • Constructor Details

    • ModId

      public ModId()
  • Method Details

    • id

      public static String id()
      Return a 12 character string using a 72 bit randomly generated ID encoded in modified base64.

      A UUID is 128 bits and this is 72 bits so quite a bit smaller but still very random with one in 4.7 * 10^21 chance of a collision.