We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var passwordHash = require('password-hash'); var hashedPassword = 'sha1$3I7HRwy7$cbfdac6008f9cab4083784cbd1874f76618d2a97'; console.log(passwordHash.isHashed('password123')); // false console.log(passwordHash.isHashed(hashedPassword)); // true
passwordHash.isHashed() will always return False?
The text was updated successfully, but these errors were encountered:
yes, the code is splitting the password with $ and checking for four segments where as the hashed password is having only 3
so, try
var passwordHash = require('password-hash'); passwordHash.isHashed = function(password) { if (!password) return false; return password.split('$').length === 3; } var hashedPassword = 'sha1$3I7HRwy7$cbfdac6008f9cab4083784cbd1874f76618d2a97'; console.log(passwordHash.isHashed('password123')); // false console.log(passwordHash.isHashed(hashedPassword)); // true
Sorry, something went wrong.
No branches or pull requests
passwordHash.isHashed() will always return False?
The text was updated successfully, but these errors were encountered: