28 return sprintf(
'%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
30 mt_rand(0, 0xffff), mt_rand(0, 0xffff),
37 mt_rand(0, 0x0fff) | 0x4000,
42 mt_rand(0, 0x3fff) | 0x8000,
45 mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
58 '/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i',
static validateUUID($uuid)
Checks if a string is a valid UUID.
static getUUID()
Returns a pseudo-random v4 UUID.