Yngvarr

Generation

generate functionSun, 29 Jan 2023

uuid personal

function uuid($personal=false){ if (!$personal) { $uuid = random_bytes(16); } else { $uuid = md5(uniqid().$personal, true); } $uuid[6] = chr(ord($uuid[6]) & 0x0f | 0x40); $uuid[8] = chr(ord($uuid[8]) & 0x3f | 0x80); return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($uuid), 4)); } uuid('admin');

Questions about programming?Chat with your personal AI assistant