and more renaming

This commit is contained in:
Administrator
2024-08-09 04:03:53 +00:00
parent 9f5a96adc0
commit 849e6b92a5
17 changed files with 4 additions and 4 deletions

43
Functions/Hash.php Normal file
View File

@ -0,0 +1,43 @@
<?php
/**
* functions/hash.php
*
* This class is used to salt, hash, and check passwords.
*
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com/Core
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Bedrock\Functions;
use TheTempusProject\Canary\Canary as Debug;
class Hash {
/**
* Uses php native hashing scheme to make a password hash.
*
* @param string $password - Validated password input.
* @return string - salted/hashed and ready to use password hash.
*/
public static function make( $password ) {
return password_hash( $password, PASSWORD_DEFAULT );
}
/**
* Uses php native password support to verify the given password.
*
* @param string $password - Password being verified.
* @param string $hash - Saved password hash.
* @return bool
*/
public static function check( $password, $hash ) {
$result = password_verify( $password, $hash );
if ( $result ) {
return true;
}
Debug::info( 'Hash::check: Failed to verify password match.' );
return false;
}
}