You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This module does not treat strings correctly as binary. No return values are valid. You need to pass 'binary' to Hash.prototype.update, or better yet, use Hash.prototype.digest without an argument (you get a Buffer object instead of a string).
Test:
var cryptmd5 = require('cryptmd5');
var cp = require('child_process');
var salts = [ '0000', 'UwV8', '92AB', ' ' ];
var passwords = [ 'password', '$iB7-tZeYp', '5a;eDIaT6Fq-NQe9:Ypj', 'UHMQUbac:_F%I*?8;HkuJdjsoVtBjzJz.J6?S;$%9,wB.cn.AKV*zrFT&3V6FN8c' ];
salts.forEach(function(salt) {
passwords.forEach(function(password) {
var opensslResult = cp.execSync('openssl passwd -1 -salt "' + salt + '" "' + password + '"').toString().trim();
var cryptmd5Result = cryptmd5.cryptMD5(password, salt);
console.log(opensslResult, cryptmd5Result, opensslResult == cryptmd5Result ? 'SUCCESS' : 'FAILED');
});
});
This module does not treat strings correctly as binary. No return values are valid. You need to pass 'binary' to
Hash.prototype.update
, or better yet, useHash.prototype.digest
without an argument (you get a Buffer object instead of a string).Test:
Output:
The text was updated successfully, but these errors were encountered: