Skip to content

Instantly share code, notes, and snippets.

@bpesquet
Last active June 6, 2017 11:10
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bpesquet/501c789f01e5bdeda90d to your computer and use it in GitHub Desktop.
Save bpesquet/501c789f01e5bdeda90d to your computer and use it in GitHub Desktop.
Hashed password generation with Silex
$app->get('/hashpwd', function() use ($app) {
$rawPassword = 'secret';
$salt = '%qUgq3NAYfC1MKwrW?yevbE';
$encoder = $app['security.encoder.bcrypt'];
return $encoder->encodePassword($rawPassword, $salt);
});
@sangimed
Copy link

it's rather $rawPassword than $raw in the first argument of $encoder->encodePassword()

@bpesquet
Copy link
Author

@sangimed Fixed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment