src/mako/utility/UUID.php
public static function v4(): string
	{
		$random = random_bytes(16);

		$random[6] = chr(ord($random[6]) & 0x0f | 0x40);

		$random[8] = chr(ord($random[8]) & 0x3f | 0x80);

		return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($random), 4));
	}
public static function v4(): string
	{
		$random = random_bytes(16);

		$random[6] = chr(ord($random[6]) & 0x0f | 0x40);

		$random[8] = chr(ord($random[8]) & 0x3f | 0x80);

		return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($random), 4));
	}
public static function v4 ( ) : string { $ random = random_bytes ( 16 ) ; $ random [ 6 ] = chr ( ord ( $ random [ 6 ] ) & 0x0f | 0x40 ) ; $ random [ 8 ] = chr ( ord ( $ random [ 8 ] ) & 0x3f | 0x80 ) ; return vsprintf ( '%s%s-%s-%s-%s-%s%s%s' , str_split ( bin2hex ( $ random ) , 4 ) ) ; }
Returns a V4 UUID.

@return string
Returns a V4 UUID .