crypto 模块提供了加密功能,其中包括了用于 OpenSSL 散列、HMAC、加密、解密、签名、以及验证的函数的一整套封装。得到的秘钥跟解密方式有关
const crypto = require('crypto')const password = 'abc123'const hash = crypto.createHash('sha1').update(password).digest('hex')console.log(hash)//6367c48dd193d56ea7b0baad25b19455e529f5ee
