Migration of user passwords from D6 (md5) to D9

Ok, I did it (maybe it will be useful to someone)....Problem: Transferring passwords from Drupal 6 (md5) to Drupal 9I was not able to solve the problem as described above, but I did find out that Drupal has a "password" service. So I'v added:services:  password:    class: Drupal\my_module\OldPasswordsService    arguments: [16]to the my_module.services.ymland made a new file in src\OldPasswordsService.php.I have changed prefix "U" on "$OLD$" for safety.<?phpnamespace Drupal\my_module;use Drupal\Component\Utility\Crypt;use Drupal\Core\Password\PhpassHashedPassword;use Drupal\Core\Password\PasswordInterface;class OldPasswordsService extends PhpassHashedPassword implements PasswordInterface {  public function check ($password, $hash) {    if (substr($hash, 0, 5) == '$OLD$') {      $stored_hash = substr($hash, 5);      $computed_hash = md5($password);      return $computed_hash && hash_equals($stored_hash, $computed_hash); // hash_equals needs php > 7.7    }    return parent::check($password, $hash);  }}  so... egz. for old md5 password with prefix $OLD$fb12564ea3257a5325abced4c02f76f0 Drupal will use OldPasswordsSercice and compare passwords with our old D6 hash. If success, user will login and password will rehash for new D9 password.Success !!!
/r/drupal Thread