Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

sangimed commented Nov 29, 2015

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

@bpesquet

This comment has been minimized.

Owner

bpesquet commented Nov 29, 2015

@sangimed Fixed, thanks!

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