srv/auth/DataSourceAuthenticationProvider.js
function (password, algorithm, salt) {
            salt = salt || Crypto.randomBytes(128).toString("hex");
            algorithm = algorithm || this.$.algorithm;

            var hash = Crypto.createHash(this.$.algorithm);
            hash.update(salt + password, "utf8");

            return [algorithm, salt, hash.digest("hex")].join(this.$.delimiter);
        }
function (password, algorithm, salt) {
            salt = salt || Crypto.randomBytes(128).toString("hex");
            algorithm = algorithm || this.$.algorithm;

            var hash = Crypto.createHash(this.$.algorithm);
            hash.update(salt + password, "utf8");

            return [algorithm, salt, hash.digest("hex")].join(this.$.delimiter);
        }
function ( password , algorithm , salt ) { salt = salt || Crypto . randomBytes ( 128 ) . toString ( "hex" ) ; algorithm = algorithm || this . $ . algorithm ; var hash = Crypto . createHash ( this . $ . algorithm ) ; hash . update ( salt + password , "utf8" ) ; return [ algorithm , salt , hash . digest ( "hex" ) ] . join ( this . $ . delimiter ) ; }
Creates an hash for a password
@param {String} password
@param {String} [algorithm] - default sha1
@param {String} [salt] - default is generated
@returns {String}
Creates an hash for a password