hashPassword() public méthode

Creates a BCrypt hash
public hashPassword ( string $password, string $staticSalt = null ) : string
$password string The plaintext password to hash
$staticSalt string Optional static salt that will not be stored in the hashed password
Résultat string the result of the crypt() call
 /**
  * @test
  */
 public function hashAndValidatePasswordWithDifferentCostsMatch()
 {
     $strategy = new BCryptHashingStrategy(10);
     $otherStrategy = new BCryptHashingStrategy(6);
     $derivedKeyWithSalt = $otherStrategy->hashPassword('password');
     $this->assertTrue($strategy->validatePassword('password', $derivedKeyWithSalt), 'Hashing strategy should validate password with different cost');
 }