prefix sub

This commit is contained in:
xiaomlove
2021-06-01 16:48:40 +08:00
parent c2446aa1e7
commit 4a3cfebadd

View File

@@ -20,6 +20,7 @@ if (!defined('REQUEST_ID')) {
$requestId = $_SERVER['REQUEST_ID'];
} else {
$prefix = ($_SERVER['SCRIPT_FILENAME'] ?? '') . implode('', $_SERVER['argv'] ?? []);
$prefix = substr(md5($prefix), 0, 5);
$requestId = bin2hex(random_bytes(11)) . str_replace('.', '', substr(uniqid($prefix, true), 12, 10));
}
define('REQUEST_ID', $requestId);