当前位置:编程学习 > php >>

HMAC-SHA1算法 php怎么写

答案:HMAC-SHA1算法 php怎么写 09-1-25</span></p> </div> <div class="b bt2"><div class="bt bg1 ft"><img alt="回答" height="16" src="/static/img/ico2.gif" width="16"/>回答</div></div> <p class="ft bb">我有一个sha1的加密函数,是javascript的 在google code上无意搜到,与PHP的sha1做过对比试验,是100%正确的。 var hexcase=0; var b64pad="="; var chrsz=8; function sha1(s){return binb2hex(core_sha1(str2binb(s),s.length*chrsz));} function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length*chrsz));} function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length*chrsz));} function hex_hmac_sha1(key,data){return binb2hex(core_hmac_sha1(key,data));} function b64_hmac_sha1(key,data){return binb2b64(core_hmac_sha1(key,data));} function str_hmac_sha1(key,data){return binb2str(core_hmac_sha1(key,data));} function sha1_test() { if(sha1("abc")=="a9993e364706816aba3e25717850c26c9cd0d89d")document.getElementById("cipher").style.display="inline"; } function sha1sumbit() { platnost=newDate; platnost.setTime(platnost.getTime() (86400000*365)); if(document.login.xcipher.checked) { document.cookie="js_cipher=1;expires=" platnost.toGMTString(); if(document.login.password.value

上一个:php 如何读取系统时间?
下一个:PHP输出数组

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,