feat : catering
This commit is contained in:
@@ -80,4 +80,20 @@ class StringUtil
|
||||
}
|
||||
return str_shuffle($password);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成 uuidV4
|
||||
* @return string
|
||||
*/
|
||||
public static function generateUUIDv4(): string
|
||||
{
|
||||
return sprintf(
|
||||
'%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
|
||||
// 32位十六进制数: 8-4-4-4-12
|
||||
mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff),
|
||||
mt_rand(0, 0x0fff) | 0x4000,
|
||||
mt_rand(0, 0x3fff) | 0x8000,
|
||||
mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user