33 Star 68 Fork 21

arrowing / Qvisitor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
getPassword.js 742 Bytes
一键复制 编辑 原始数据 按行查看 历史
arrowing 提交于 2014-06-11 10:55 . Qvisitor first commit
var reg = new RegExp("\\\\x", "g"),
str_pad = require('./str_pad'),
crypto = require('crypto'),
md5 = function (str) {
var md5sum = crypto.createHash('md5');
md5sum.update(str);
str = md5sum.digest('hex');
return str;
},
hex2char = function ($num){
$s = '';
for(var $i=0;$i<$num.length;$i+=2){
$s += String.fromCharCode( parseInt( $num.substr($i, 2), 16 ));
}
return $s;
};
module.exports = function getPassword($qq, $password, $verifycode){
$uin = str_pad(parseInt($qq).toString(16), 16, "0", 'STR_PAD_LEFT');
$p = hex2char(md5($password));
$u = md5( $p + hex2char( $uin.replace(reg, "") ) ).toUpperCase();
$v = md5( $u + $verifycode.toUpperCase() ).toUpperCase();
return $v;
};
JavaScript
1
https://gitee.com/arrowing/Qvisitor.git
git@gitee.com:arrowing/Qvisitor.git
arrowing
Qvisitor
Qvisitor
master

搜索帮助