03-12-2017, 02:33 AM
Hello, I have 2 function for encode and decode.
So I upgrade php to php7.1 and I can not use encrypt old library.
now I try to using encryption new library.
and I get string / = + after encrypt because / it make can not pass string on url
Pls, I need you help.
So I upgrade php to php7.1 and I can not use encrypt old library.
now I try to using encryption new library.
and I get string / = + after encrypt because / it make can not pass string on url
Pls, I need you help.
PHP Code:
public function encode_me($string, $key = '') {
//$this->load->library('encrypt');
//return rtrim(strtr(base64_encode($this->encrypt->mcrypt_encode($string, $this->encrypt->get_key($key))), '+/', '-_'), '=');
$this->load->library('encryption');
return $this->encryption->encrypt($string);
}
public function decode_me($string, $key = '') {
//$this->load->library('encrypt');
//return $this->encrypt->mcrypt_decode(base64_decode(str_pad(strtr($string, '-_', '+/'), strlen($string) % 4, '=', STR_PAD_RIGHT)), $this->encrypt->get_key($key));
$this->load->library('encryption');
return $this->encryption->decrypt($string);
}