PHP code example of jiriferkl / dumbpass

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

    

jiriferkl / dumbpass example snippets


$pass = 'P@ss_wo!rd!5';

$result = DumbPass::verify($pass);

$pass = 'P@ss_wo!rd!5';

$criteria = new Criteria();
$criteria->enforceCapitalChars(TRUE)
	->enforceNumberChars(TRUE)
	->enforceSpecialChars(TRUE)
	->enforceLowerCaseChars(TRUE)
	->allowCommonPassCheck(TRUE)
	->setLength(8);

$result = DumbPass::verify($pass, $criteria);

$pass = 'P@ss_wo!rd!5';

//null -> default object
$result = DumbPass::verify($pass, NULL, Localization::get(Localization::CZ));

$pass = 'P@ss_wo!rd!5';

$messages = new Messages(); //implements IMessage

//null -> default object
$result = DumbPass::verify($pass, NULL, NULL, $messages);

$pass = 'P@ss_wo!rd!5';

$passList = new PassList(); //implements IPassList

//null -> default object
$result = DumbPass::verify($pass, NULL, NULL, NULL, $passList);