npm install bcryp --save 安装不成功,所以
用bcrypt-node.js来替换bcrypt,但是bcrypt-node的hash参数有四个
function hash(data, salt, progress, callback) {
/*
data - [REQUIRED] - the data to be encrypted.
salt - [REQUIRED] - the salt to be used to hash the password. if specified as a number then a salt will be generated and used (see examples).
progress - a callback to be called during the hash calculation to signify progress
callback - [REQUIRED] - a callback to be fired once the data has been encrypted. uses eio making it asynchronous.
error - First parameter to the callback detailing any errors.
encrypted - Second parameter to the callback providing the encrypted form.
*/
比bcrypt多了一个progress参数,该参数是一个回调函数
解决方法:
在bcrypt-node.js 的function hash(data, salt, progress, callback) 方法中加入
if(typeof callback == 'undefined') {
callback = progress;
progress = null;
}
而别的模块调用hash的时候progress参数设置为null即可,
bcrypt.hash(user.password, salt,null, function(err, hash)
分享到:
相关推荐
前端开源库-bcrypt-node.zip
python库。 资源全名:bcrypt-3.1.2-cp27-cp27mu-manylinux1_x86_64.whl
前端开源库-bcrypt-nodebcrypt节点,用于node js的本机js bcrypt库。
资源来自pypi官网。 资源全名:bcrypt-3.1.0-cp26-cp26mu-manylinux1_i686.whl
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
python库。 资源全名:bcrypt-3.1.0-cp27-cp27m-win32.whl
支持的算法名称Crates.io文档PBKDF2 scrypt bcrypt-pbkdf许可您可以选择根据Apache许可,2.0版MIT许可中的任何一个许可使用所有箱子。 稿件除非您明确声明,否则,您有意按定义将任何稿件提交给您的作品
bcrypt-ruby, bcrypt ruby 是用于 OpenBSD bcrypt() 密码散列算法的ruby 绑定,允许你轻松地存储...http://github.com/codahale/bcrypt-ruby/tree/master 为什么应该使用 bcrypt()如果你将用户密码存储在明文中,那么
资源来自pypi官网。 资源全名:bcrypt-1.1.1-cp27-none-win_amd64.whl
资源来自pypi官网,解压后可用。 资源全名:bcrypt-3.1.0-cp26-cp26m-win_amd64.whl
python库,解压后可用。 资源全名:bcrypt-3.1.0-cp26-cp26mu-manylinux1_i686.whl
资源来自pypi官网。 资源全名:bcrypt-3.1.2-cp35-cp35m-manylinux1_i686.whl
bcrypt-源码.rar
资源来自pypi官网。 资源全名:bcrypt-3.1.4-cp34-cp34m-macosx_10_6_intel.whl
资源分类:Python库 所属语言:Python 使用前提:需要解压 资源全名:bcrypt-3.1.7-cp38-cp38-win_amd64.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
离线安装包,亲测可用