getSalt() public static method

Optionally takes a seed and a plaintext password, to extract the seed of an existing password, or for encryption types that use the plaintext in the generation of the salt.
public static getSalt ( string $encryption = 'md5-hex', string $seed = '', string $plaintext = '' ) : string
$encryption string The kind of pasword encryption to use. Defaults to md5-hex.
$seed string The seed to get the salt from (probably a previously generated password). Defaults to generating a new seed.
$plaintext string The plaintext password that we're generating a salt for. Defaults to none.
return string The generated or extracted salt.
示例#1
0
 /**
  * @dataProvider getCredentials
  */
 public function testGetSalt($encryption, $password, $salt)
 {
     $this->assertEquals($salt, Horde_Auth::getSalt($encryption, $password, 'foobar'));
 }