Passwords.encryptPassword()

Encrypt a string using the BCrypt algorithm.

This is particularly useful for encrypting user passwords before storing them in the database.

Usage

Hover over inputs/exits for more info.

var Passwords = require('machinepack-passwords');


// Encrypt a string using the BCrypt algorithm.

Passwords.encryptPassword({

password: 'l0lcatzz',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

password required

String to be encrypted

'l0lcatzz'

Exits

error

An unexpected error occurred.

success

OK.

'2$a492.abc3fadifhoi3hesdqd'