Skip to content

Instantly share code, notes, and snippets.

@aleckyann
Created May 1, 2018 21:26
Show Gist options
  • Save aleckyann/8a785513f4c2f6765a539d5007567a83 to your computer and use it in GitHub Desktop.
Save aleckyann/8a785513f4c2f6765a539d5007567a83 to your computer and use it in GitHub Desktop.
Classe para abstrair criação de password com php
<?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