php根据用户uuid获取token

180it 2019-12-11 PM 2841℃ 0条

/**

 * 根据用户uuid获取token
 * @param  [type] $uuid [description]
 * @return [type]       [description]
 */
public function getToken($uuid)
{
    $v = $uuid;
    $key = mt_rand();
    $hash = hash_hmac("sha1", $v . mt_rand() . time(), $key, true);
    $token = str_replace('=', '', base64_encode($hash));
    return $token;
}
支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!

标签: none

php根据用户uuid获取token