How to use the bcrypt-nodejs.genSaltSync function in bcrypt-nodejs

To help you get started, we’ve selected a few bcrypt-nodejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JKHeadley / rest-hapi / api / utilities / password-helper.js View on Github external
var hash_password = function(plaintext) {
    var salt = bcrypt.genSaltSync(10);
    var hash = bcrypt.hashSync(plaintext, salt);
    return hash;
};
github saggiyogesh / nodeportal / lib / PasswordUtil.js View on Github external
exports.encryptSync = function(password){
    var algo = AppProperties.get("PASSWORD_ENC_ALGO");
    if (algo == BCRYPT) {
        var bcrypt = require('bcrypt-nodejs');
        var salt = bcrypt.genSaltSync(10);
        return bcrypt.hashSync(password, salt);
    }
    else {
        return getSHA1Hash(password);
    }
};
github gustavohenrique / gh1 / server / nodejs / src / models / User.js View on Github external
function hashPassword (instance) {
        var salt = bcrypt.genSaltSync(10);
        var hash = bcrypt.hashSync(instance.password, salt);
        instance.password = hash;
    }
github mgm-interns / team-radio / server / src / entities / user / User.ts View on Github external
public generateToken() {
    const secret = `${this.username}${this.email}${Date.now()}`;
    const token = Bcrypt.hashSync(secret, Bcrypt.genSaltSync(4));
    const refreshToken = Bcrypt.hashSync(secret, Bcrypt.genSaltSync(2));
    this.authToken = new AuthToken(token, refreshToken);
  }
github mgm-interns / team-radio / server / src / entities / user / User.ts View on Github external
public generateToken() {
    const secret = `${this.username}${this.email}${Date.now()}`;
    const token = Bcrypt.hashSync(secret, Bcrypt.genSaltSync(4));
    const refreshToken = Bcrypt.hashSync(secret, Bcrypt.genSaltSync(2));
    this.authToken = new AuthToken(token, refreshToken);
  }

bcrypt-nodejs

A native JS bcrypt library for NodeJS.

Unknown
Latest version published 12 years ago

Package Health Score

39 / 100
Full package analysis