哈希算法加密,单程加密方式
在加密的密码中加入随机字符串增加密码被破解的难度
bcrypt依赖的运行环境
- python
官网下载安装即可 - node-gyp node的Python的编译环境
管理员身份打开:WindowsPowerShell,使用 npm install -g node-gyp 命令下载安装 - windows-build-tools windows下的编译环境
使用 npm install --global --production windows-build-tools 命令下载安装,这个时间会长一点
第一次安装的时候,文件其实都下完了的,但是就卡在Successfully installed Python 2.7,第二天早上重新安装一下子就好了
bcrypt安装
使用 npm install bcrypt 命令下载安装
使用方式
// 导入bcrypt模块
const bcrypt = require(