public function hashPassword($password, $staticSalt = null)
    {
        $dynamicSalt = UtilityAlgorithms::generateRandomBytes($this->dynamicSaltLength);
        $result = CryptographyAlgorithms::pbkdf2($password, $dynamicSalt . $staticSalt, $this->iterationCount, $this->derivedKeyLength, $this->algorithm);
        return base64_encode($dynamicSalt) . ',' . base64_encode($result);
    }
public function hashPassword($password, $staticSalt = null)
    {
        $dynamicSalt = UtilityAlgorithms::generateRandomBytes($this->dynamicSaltLength);
        $result = CryptographyAlgorithms::pbkdf2($password, $dynamicSalt . $staticSalt, $this->iterationCount, $this->derivedKeyLength, $this->algorithm);
        return base64_encode($dynamicSalt) . ',' . base64_encode($result);
    }
public function hashPassword ( $ password , $ staticSalt = null ) { $ dynamicSalt = UtilityAlgorithms :: generateRandomBytes ( $ this -> dynamicSaltLength ) ; $ result = CryptographyAlgorithms :: pbkdf2 ( $ password , $ dynamicSalt . $ staticSalt , $ this -> iterationCount , $ this -> derivedKeyLength , $ this -> algorithm ) ; return base64_encode ( $ dynamicSalt ) . ',' . base64_encode ( $ result ) ; }
Hash a password for storage using PBKDF2 and the configured parameters.
Will use a combination of a random dynamic salt and the given static salt.

@param string $password Cleartext password that should be hashed
@param string $staticSalt Static salt that will be appended to the random dynamic salt
@return string A Base64 encoded string with the derived key (hashed password) and dynamic salt
Hash a password for storage using PBKDF2 and the configured parameters . Will use a combination of a random dynamic salt and the given static salt .