PHP code example of whitehat101 / apr1-md5

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

    

whitehat101 / apr1-md5 example snippets


use WhiteHat101\Crypt\APR1_MD5;

// Check plaintext password against an APR1-MD5 hash
echo APR1_MD5::check('plaintext', '$apr1$PVWlTz/5$SNkIVyogockgH65nMLn.W1');

// Hash a password with a known salt
echo APR1_MD5::hash('PASSWORD', '__SALT__');

// Hash a password with a secure random salt
echo APR1_MD5::hash('PASSWORD');

// Generate a secure random salt
echo APR1_MD5::salt();