This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib,base64 | |
def checkPass(password,salt): | |
salted=(password+'{'+salt+'}').encode('utf-8') | |
if not salt: | |
salted=password.encode('utf-8') | |
m=hashlib.sha512() | |
m.update(salted) | |
digest=m.digest() |