feat : catering

This commit is contained in:
2025-03-12 17:26:11 +08:00
parent 3858bc4a5d
commit 467f44f847
12 changed files with 1114 additions and 54 deletions

View File

@@ -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)
);
}
}