PHP code example of brandonkahre / miva-password

1. Go to this page and download the library: Download brandonkahre/miva-password 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/ */

    

brandonkahre / miva-password example snippets




use MivaPassword\Password as MivaPassword;

// generate a random password
$password = MivaPassword::generate(10);

// generate a hash for a password
$hash = MivaPassword::create_hash($password);

// verify that the password matches that hash
if (MivaPassword::verify($hash, $password)) {
    echo 'All is right in the world';
}