Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 7.2+ support [mcrypt removed] #2

Open
lubos-h opened this issue Mar 14, 2021 · 0 comments
Open

PHP 7.2+ support [mcrypt removed] #2

lubos-h opened this issue Mar 14, 2021 · 0 comments

Comments

@lubos-h
Copy link

lubos-h commented Mar 14, 2021

Hello, please would you add support for PHP 7.2+ ?

the createHash function uses mcrypt which is removed since PHP 7.2
https://www.php.net/manual/en/function.mcrypt-module-open.php

public function createHash($string)
{
    $key = pack('H*', $this->getKey());
    $string = substr(sha1($string), 0, 32);
    $cipher = **mcrypt_module_open**(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_ECB, '');
    $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($cipher), MCRYPT_DEV_URANDOM);

    mcrypt_generic_init($cipher, $key, $iv);
    $sign = mcrypt_generic($cipher, pack('H*', $string));
    mcrypt_generic_deinit($cipher);

    return strtoupper(bin2hex($sign));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant