需要的自行拿走有问题留言
function hashMiaoSpeed($token, $request) {
$buildTokens = array_merge([$token], explode("|", trim(BUILDTOKEN)));
$hasher = hash_init("sha512");
hash_update($hasher, $request);
foreach ($buildTokens as $t) {
if ($t == "") {
$t = "SOME_TOKEN";
}
$copy = hash_copy($hasher);
hash_update($copy, $t);
hash_update($copy, hash_final($hasher, true));
$hasher = $copy;
}
$hash = hash_final($hasher, true);
$hashUrlSafe = strtr(base64_encode($hash), '+/', '-_');
return $hashUrlSafe;
}