9declare( strict_types = 1 );
22 private static $digestAlgos;
40 private const DIGEST_ALGOS = [
46 if ( self::$digestAlgos === null ) {
47 self::$digestAlgos = array_intersect( self::DIGEST_ALGOS, openssl_get_md_methods() );
49 return self::$digestAlgos[$algo] ??
null;
60 while ( openssl_error_string() !== false );
61 $hash = openssl_pbkdf2( $password, $salt, $length, $rounds, $digestAlgo );
62 if ( !is_string( $hash ) ) {
63 throw new PasswordError(
'Error when hashing password: ' . openssl_error_string() );
70class_alias( Pbkdf2PasswordUsingOpenSSL::class,
'Pbkdf2PasswordUsingOpenSSL' );
if(!defined('MW_SETUP_CALLBACK'))