Last active
June 6, 2017 11:10
-
-
Save bpesquet/501c789f01e5bdeda90d to your computer and use it in GitHub Desktop.
Hashed password generation with Silex
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
$app->get('/hashpwd', function() use ($app) { | |
$rawPassword = 'secret'; | |
$salt = '%qUgq3NAYfC1MKwrW?yevbE'; | |
$encoder = $app['security.encoder.bcrypt']; | |
return $encoder->encodePassword($rawPassword, $salt); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it's rather $rawPassword than $raw in the first argument of $encoder->encodePassword()