Sulu\Component\Security\Authentication\SaltGenerator::getRandomSalt PHP Method

getRandomSalt() public method

Returns a random salt for password hashing.
public getRandomSalt ( ) : string
return string
    public function getRandomSalt()
    {
        $generator = new SecureRandom();
        return base64_encode($generator->nextBytes(32));
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Generates a random salt for the password.
  *
  * @return string
  */
 private function generateSalt()
 {
     return $this->saltGenerator->getRandomSalt();
 }
All Usage Examples Of Sulu\Component\Security\Authentication\SaltGenerator::getRandomSalt
SaltGenerator