I am using bcrypt package to generate encrypt passwords. I am using the code below to encrypt the password:
let bcrypt = require('bcrypt');
var hash = bcrypt.hashSync(password, 10);
It returns different hash for same password. But my requirement is that I need same hash for same password. Please let me is it possible using bcrypt package. If not please suggest me different package that I can use?
EDIT: I am using oauth2-server package. And with this package I am generation token. So in this package there is no way to compare the hash. As that work is handled internally by the package. So I am looking for package that can give me same hash.