23declare( strict_types = 1 );
36 private static $digestAlgos;
54 private const DIGEST_ALGOS = [
60 if ( !isset( self::$digestAlgos ) ) {
61 self::$digestAlgos = array_intersect( self::DIGEST_ALGOS, openssl_get_md_methods() );
63 return self::$digestAlgos[$algo] ??
null;
74 while ( openssl_error_string() !== false );
75 $hash = openssl_pbkdf2( $password, $salt, $length, $rounds, $digestAlgo );
76 if ( !is_string( $hash ) ) {
77 throw new PasswordError(
'Error when hashing password: ' . openssl_error_string() );
84class_alias( Pbkdf2PasswordUsingOpenSSL::class,
'Pbkdf2PasswordUsingOpenSSL' );
if(!defined('MW_SETUP_CALLBACK'))