class UniqueId (View source)

Methods

static string
generateCustom(string $prefix, int $length = 128)

Generate a custom uid starting from a prefix

static string
generate(int $length = 128)

Generate an uid

static string
getUid()

Generate an uid (128 bit / 32 char random)

Details

static string generateCustom(string $prefix, int $length = 128)

Generate a custom uid starting from a prefix

The result uid format will be $string-[random]

Parameters

string $prefix
int $length

Return Value

string

static string generate(int $length = 128)

Generate an uid

Parameters

int $length

Return Value

string

static protected string getUid()

Generate an uid (128 bit / 32 char random)

Return Value

string