Jump to content
Sign in to follow this  
bes

[Забанили в поиске...] Как исправить ошибку

Recommended Posts

Выдается ошибка Fatal error: Call to undefined function hash() in.............../upload/system/library/encryption.php on line 7

 

<?php

final class Encryption {
private $key;
private $iv;
 
public function __construct($key) {
        $this->key = hash('sha256', $key, true);
$this->iv = mcrypt_create_iv(32, MCRYPT_RAND);
}
 
public function encrypt($value) {
return strtr(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->key, $value, MCRYPT_MODE_ECB, $this->iv)), '+/=', '-_,');
}
 
public function decrypt($value) {
return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->key, base64_decode(strtr($value, '-_,', '+/=')), MCRYPT_MODE_ECB, $this->iv));
}
}
?>

Share this post


Link to post
Share on other sites

Поиск по слову "call to undefined function hash()" вернул 12 результатов

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.