Skip to content

Instantly share code, notes, and snippets.

@efiku
Created November 5, 2015 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save efiku/dbb151cef154e623feff to your computer and use it in GitHub Desktop.
Save efiku/dbb151cef154e623feff to your computer and use it in GitHub Desktop.
Example using password_hash/veirfy
<?php
/**
* Created by PhpStorm.
* User: efik
*/
$bs = [];
$password = "supertajnehaslo";
$hash = password_hash($password, PASSWORD_BCRYPT);
$verify = password_verify($password, $hash);
// zle haslo ale ten sam hash
$passwordBad = "SuperTajneHaslo";
$verifyBad = password_verify($passwordBad, $hash);
$bs[0] = [
"haslo" => $password,
"hash" => $hash,
"verify" => $verify
];
$bs[1] = [
"haslo" => $passwordBad,
"hash" => $hash,
"verify" => $verifyBad
];
var_dump($bs);
@efiku
Copy link
Author

efiku commented Nov 5, 2015

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