Skip to content

Instantly share code, notes, and snippets.

@themonti
themonti / Symfony2PasswordEncode.js
Last active February 14, 2019 12:46 — forked from konstantinzolotarev/Symfony2PasswordEncode.js
Function for node.js that will encrypt password exactly like Symfony2 PHP framework. So all passwords from Symfony2 will work in your node.js application
'use strict';
var crypto = require('crypto');
var _ = require('lodash');
/**
* Will encrypt password in Symfony2 way using a given salt.
*
* @param {string} password
* @param {string} salt