标签:array key time ase arp sort lis query pre
//得到时间戳 list($msec, $sec) = explode(‘ ‘, microtime()); $time = (float)sprintf(‘%.0f‘, (floatval($msec) + floatval($sec)) * 1000); //代签名字符串 $tok = array(); //排序 ksort($tok); $arr = http_build_query($tok); $arr = urldecode($arr); $arr = base64_encode($arr); $private_key = ‘-----BEGIN RSA PRIVATE KEY----- -----END RSA PRIVATE KEY-----‘; openssl_sign($arr, $signature, $private_key, OPENSSL_ALGO_SHA1); $sign = base64_encode($signature); dump($sign);
标签:array key time ase arp sort lis query pre
原文地址:https://www.cnblogs.com/JANCHAN/p/9409464.html