Created
September 14, 2015 05:44
-
-
Save ooooak/ad8ec6c71adeae943a74 to your computer and use it in GitHub Desktop.
laravel bcrypt function
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
<?php | |
function bcrypt($password) | |
{ | |
$hash = password_hash($password, PASSWORD_BCRYPT, ['cost' => 10]); | |
if ($hash === false) | |
{ | |
throw new RuntimeException('Bcrypt hashing not supported.'); | |
} | |
return $hash; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice!