微信小程序提供了wx.createHash
API来实现MD5加密:
// 创建MD5哈希
const md5Hash = wx.createHash('md5')
// 更新要加密的内容
md5Hash.update('要加密的字符串')
// 获取加密结果(16进制字符串)
const md5Result = md5Hash.digest('hex')
console.log(md5Result) // 输出MD5哈希值
微信小程序提供了wx.createHash
API来实现MD5加密:
// 创建MD5哈希
const md5Hash = wx.createHash('md5')
// 更新要加密的内容
md5Hash.update('要加密的字符串')
// 获取加密结果(16进制字符串)
const md5Result = md5Hash.digest('hex')
console.log(md5Result) // 输出MD5哈希值
0 个评论