import bcrypt from 'bcrypt';
export default class Hash {
static hashPassword (password: any): string {
let hashed: string;
bcrypt.hash(password, 10, function(err, hash) {
if (err) console.log(err);
else {
hashed = hash;
}
});
return hashed;
}
}
this function returns undefined everytime