PHP code example of basteyy / minimal-hash-wrapper

1. Go to this page and download the library: Download basteyy/minimal-hash-wrapper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

basteyy / minimal-hash-wrapper example snippets


$userPassword = 'foobar';
$userPasswordHashed = \basteyy\MinimalHashWrapper\MinimalHashWrapper::getHash($userPassword);

if(\basteyy\MinimalHashWrapper\MinimalHashWrapper::compare(
    $_POST['password'], // From a form for example
    $user->password // From a database for example
)) {
    echo 'Password was correct. Welcome back user!';
} else {
    echo 'Okay cowboy .. something is wrong';
}