File ManagerCurrent Directory: wp-content/plugins/wpforms/pro/libs/bjeavons/zxcvbn-php/srcLinux appserver-0d5e4f1e-php-cc8da225320a42ba9b7d66cba40b1f03 6.6.123+ #1 SMP PREEMPT_DYNAMIC Wed Mar 11 09:04:28 UTC 2026 x86_64Edit File: Zxcvbn.php <?php namespace ZxcvbnPhp; /** * The main entry point. * * @see zxcvbn/src/main.coffee */ class Zxcvbn { /** * @var */ protected $matcher; /** * @var */ protected $scorer; /** * @var */ protected $timeEstimator; /** * @var */ protected $feedback; public function __construct() { $this->matcher = new \ZxcvbnPhp\Matcher(); $this->scorer = new \ZxcvbnPhp\Scorer(); $this->timeEstimator = new \ZxcvbnPhp\TimeEstimator(); $this->feedback = new \ZxcvbnPhp\Feedback(); } public function addMatcher(string $className) { $this->matcher->addMatcher($className); return $this; } /** * Calculate password strength via non-overlapping minimum entropy patterns. * * @param string $password Password to measure * @param array $userInputs Optional user inputs * * @return array Strength result array with keys: * password * entropy * match_sequence * score */ public function passwordStrength($password, array $userInputs = []) { $timeStart = microtime(true); $sanitizedInputs = array_map( function ($input) { return mb_strtolower((string) $input); }, $userInputs ); // Get matches for $password. // Although the coffeescript upstream sets $sanitizedInputs as a property, // doing this immutably makes more sense and is a bit easier $matches = $this->matcher->getMatches($password, $sanitizedInputs); $result = $this->scorer->getMostGuessableMatchSequence($password, $matches); $attackTimes = $this->timeEstimator->estimateAttackTimes($result['guesses']); $feedback = $this->feedback->getFeedback($attackTimes['score'], $result['sequence']); return array_merge( $result, $attackTimes, [ 'feedback' => $feedback, 'calc_time' => microtime(true) - $timeStart ] ); } } Upload File Directory Listing NameTypeSizeActions.. (Parent Directory)DirFeedback.phpFile1.43 KB Rename | Delete | EditMatcher.phpFile3.38 KB Rename | Delete | EditMatchersDirectory Rename | DeleteScorer.phpFile9.72 KB Rename | Delete | EditTimeEstimator.phpFile3.18 KB Rename | Delete | EditZxcvbn.phpFile2.12 KB Rename | Delete | Edit