美文网首页
nodejs 使用md5加密和Python、php的不一样

nodejs 使用md5加密和Python、php的不一样

作者: burgess123 | 来源:发表于2021-12-15 15:38 被阅读0次

当对接腾讯的语音识别相关的api的时候,签名需要使用md5加密,但是我使用node加密后,接口一直说签名无效,原来是自己node的使用问题,小记一下:
需要先用Buffer对str进行处理

var signature = crypto.createHash('md5').update(new Buffer(str)).digest('hex');

相关文章

网友评论

      本文标题:nodejs 使用md5加密和Python、php的不一样

      本文链接:https://www.haomeiwen.com/subject/irlpfrtx.html