Simple Message Digest Password Encoder with CryptoJS lib
Reproduces Symfony MessageDigestPasswordEncoder's behavior in javscript with CryptoJs library.
Via Bower:
bower install cryptojs-password-encoder --save
And in your html file:
<script type="text/javascript" src="bower_components/cryptojslib/rollups/sha512.js"></script>
<script type="text/javascript" src="bower_components/cryptojslib/components/enc-base64.js"></script>
<script type="text/javascript" src="bower_components/cryptojs-password-encoder/CryptoJsPasswordEncoder.js"></script>
var encoder = new CryptoJsPasswordEncoder('sha512', true, 5000);
encoder.encodePassword('pass0', 'salt');
// returns "UcC4fzoeOb94BdO3stpYywrwaTGeZaLhS2ywdso7t2ZHnf3vjmLMyEZ4j7IMpj9ZZdRGjhw9K0Fc1XDhbcL3bQ=="