Created
May 1, 2018 21:26
-
-
Save aleckyann/8a785513f4c2f6765a539d5007567a83 to your computer and use it in GitHub Desktop.
Classe para abstrair criação de password com php
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 | |
defined('BASEPATH') OR exit('No direct script access allowed'); | |
class Password { | |
/** | |
* Cria o password | |
*/ | |
public function create($password_input) | |
{ | |
return password_hash($password_input, PASSWORD_DEFAULT); | |
} | |
/** | |
* Compara password do input com hash criada pelo método create | |
*/ | |
public function check($password_input, $password_database) | |
{ | |
return password_verify($password_input, $password_database); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment