PHP code example of zonuexe / apr1-md5
1. Go to this page and download the library: Download zonuexe/apr1-md5 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/ */
zonuexe / apr1-md5 example snippets
use zonuexe\Apr1md5;
// Check plaintext password against an APR1-MD5 hash
echo Apr1md5::check('plaintext', '$apr1$PVWlTz/5$SNkIVyogockgH65nMLn.W1');
// Hash a password with a known salt
echo Apr1md5::hash('PASSWORD', '__SALT__');
// Hash a password with a secure random salt
echo Apr1md5::hash('PASSWORD');
// Generate a secure random salt
echo Apr1md5::salt();