lib/authenticator.js
function encryptPassword(password, callback) {
        bcrypt.gen_salt(workFactor, function(err, salt) {
            if (err) callback(err);
            
            bcrypt.encrypt(password, salt, function(err, hashedPassword) {
                if (err) callback(err);
                
                callback(null, hashedPassword);
            });
        });
    }
function encryptPassword(password, callback) {
        bcrypt.gen_salt(workFactor, function(err, salt) {
            if (err) callback(err);
            
            bcrypt.encrypt(password, salt, function(err, hashedPassword) {
                if (err) callback(err);
                
                callback(null, hashedPassword);
            });
        });
    }
function encryptPassword ( password , callback ) { bcrypt . gen_salt ( workFactor , function ( err , salt ) { if ( err ) callback ( err ) ; bcrypt . encrypt ( password , salt , function ( err , hashedPassword ) { if ( err ) callback ( err ) ; callback ( null , hashedPassword ) ; } ) ; } ) ; }
Encrypts a password
@param {String}      Password
@param {Function}    Callback (receives: err, hashedPassword)
Encrypts a password