modified 兼容PHP-7.4.*版本

This commit is contained in:
zhaoxiang 2020-10-14 16:06:25 +08:00
parent 28c8927e59
commit f1e129f752

View File

@ -20,7 +20,7 @@ class Strs {
* @return string * @return string
*/ */
public static function uuid(): string { public static function uuid(): string {
$charId = md5(uniqid(mt_rand(), true)); $charId = md5(uniqid(strval(mt_rand()), true));
$hyphen = chr(45); $hyphen = chr(45);
$uuid = chr(123) $uuid = chr(123)
. substr($charId, 0, 8) . $hyphen . substr($charId, 0, 8) . $hyphen