eZ\Publish\Core\Repository\UserService::createPasswordHash PHP Method

createPasswordHash() protected method

Returns password hash based on user data and site settings.
protected createPasswordHash ( string $login, string $password, string $site, integer $type ) : string
$login string User login
$password string User password
$site string The name of the site
$type integer Type of password to generate
return string Generated password hash
    protected function createPasswordHash($login, $password, $site, $type)
    {
        switch ($type) {
            case User::PASSWORD_HASH_MD5_PASSWORD:
                return md5($password);
            case User::PASSWORD_HASH_MD5_USER:
                return md5("{$login}\n{$password}");
            case User::PASSWORD_HASH_MD5_SITE:
                return md5("{$login}\n{$password}\n{$site}");
            case User::PASSWORD_HASH_PLAINTEXT:
                return $password;
            default:
                return md5($password);
        }
    }