TypeError: HashUpdate fail
关于crypto的md5加密报错:
代码:
var crypto = require('crypto');
var md5 = crypto.createHash('md5'); //crypto模块功能是加密并生成各种散列
var oldpass = md5.update(oldpass).digest('hex');
var newpass = md5.update(newpass).digest('hex');
如果md5.update只使用一次则不会出错,多次就会报错

修改为每次重新构建md5:
var crypto = require('crypto');
var oldpass = crypto.createHash('md5').update(oldpass).digest('hex');
var newpass = crypto.createHash('md5').update(newpass).digest('hex');
结果正确。
TypeError: HashUpdate fail的更多相关文章
- js object 常用方法总结
Object.assign(target,source1,source2,...) 该方法主要用于对象的合并,将源对象source的所有可枚举属性合并到目标对象target上,此方法只拷贝源对象的自身 ...
- jQuery对象的操作
参考一篇不错的文章:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object 1. ...
- Python 命令行之旅:深入 click 之参数篇
作者:HelloGitHub-Prodesire HelloGitHub 的<讲解开源项目>系列,项目地址:https://github.com/HelloGitHub-Team/Arti ...
- DRF源码-fields.py
https://www.cnblogs.com/pyspark/p/8607801.html https://www.cnblogs.com/LYliangying/articles/9896548. ...
- SignalR代理对象异常:Uncaught TypeError: Cannot read property 'client' of undefined 推出的结论 SignalR 简单示例 通过三个DEMO学会SignalR的三种实现方式 SignalR推送框架两个项目永久连接通讯使用 SignalR 集线器简单实例2 用SignalR创建实时永久长连接异步网络应用程序
SignalR代理对象异常:Uncaught TypeError: Cannot read property 'client' of undefined 推出的结论 异常汇总:http://www ...
- 微信小程序--分享报错(thirdScriptError Cannot read property 'from' of undefined;at pages/index/index page onShareAppMessage function TypeError: Cannot read property 'from' of undefined)
分享功能: onShareAppMessage: function (res) { if (res.from === 'button') { // 来自页面内转发按钮 console.log(res. ...
- 微信小程序开发——使用回调函数出现异常:TypeError: Cannot read property 'setData' of undefined
关键技术点: 作用域问题——回调函数中的作用域已经脱离了调用函数了,因此需要在回调函数外边把this赋给一个新的变量才可以了. 业务需求: 微信小程序开发,业务逻辑需要,需要把获取手机号码的业务逻辑作 ...
- jquery each报 Uncaught TypeError: Cannot use 'in' operator to search for错误
用$.each()来遍历后台传过来的json数据.直接遍历传过来的数据时就发生 Uncaught TypeError: Cannot use 'in' operator to search for 这 ...
- python中的TypeError错误解决办法
新手在学习python时候,会遇到很多的坑,下面来具体说说其中一个. 在使用python编写面向对象的程序时,新手可能遇到TypeError: this constructor takes no ar ...
随机推荐
- shell case语句
case 格式 case 值 in 模式1) command1 command2 ... commandN ;; 模式2) command1 command2 ... commandN ;; esac ...
- BN层
论文名字:Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift 论 ...
- 创意时钟 人形时钟 可惜不是 https
; (function () { $('#header').css({ 'position':'relative' }).prepend('<div id="clockWrap&quo ...
- VSAN Cluster Failed
failed message:AdVanced vSAN configuration in syncChecks if all of the hosts in a vSAN cluster have ...
- Java 常用对象-String类
2017-11-02 20:02:06 String:代表字符串.Java 程序中的所有字符串字面值(如 "abc" )都作为此类的实例实现. 字符串是常量:它们的值在创建之后不能 ...
- Python 爬虫-获得大学排名
2017-07-29 23:20:24 主要技术路线:requests+bs4+格式化输出 import requests from bs4 import BeautifulSoup url = 'h ...
- Python 爬虫-BeautifulSoup
2017-07-26 10:10:11 Beautiful Soup可以解析html 和 xml 格式的文件. Beautiful Soup库是解析.遍历.维护“标签树”的功能库.使用Beautifu ...
- [Java学习] Java类的基本运行顺序
我们以下面的类来说明一个基本的 Java 类的运行顺序: 1. public class Demo{ 2. private String name; 3. private int age; 4. 5. ...
- 12月22日 update_columns,完成第9节。
Update_columns(attributes) //等同于update_column 直接更新database. 使用UPdate SQL 语法. ⚠️ :忽略了validations, Cal ...
- sgu 121. Bridges painting 列举情况 难度:1
121. Bridges painting time limit per test: 0.25 sec. memory limit per test: 4096 KB New Berland cons ...