nodejs 完全模拟php中的hash_hmac
nodejs吧
全部回复
仅看楼主
level 1
qq597353
楼主
最近搞一个项目需要用到md5的方式做key加密,php中有类似函数,js没有找到于是自己改了一个
function hash_hmac(algo,data,key,raw_output=false){
var hmac = crypto.createHmac(algo,key);
hmac.update(data);
return hmac.digest(raw_output?'binary':'hex');
};
2019年07月18日 17点07分
1
1