CI_Encrypt::encode PHP Method

encode() public method

Encodes the message string using bitwise XOR encoding. The key is combined with a random hash, and then it too gets converted using XOR. The whole thing is then run through mcrypt using the randomized key. The end result is a double-encrypted message string that is randomized with each call to this function, even if the supplied message and key are the same.
public encode ( $string, $key = '' ) : string
return string
    public function encode($string, $key = '')
    {
        return base64_encode($this->mcrypt_encode($string, $this->get_key($key)));
    }

Usage Example

示例#1
0
 function encode($string, $key = "", $url_safe = TRUE)
 {
     $ret = parent::encode($string, $key);
     if ($url_safe) {
         $ret = strtr($ret, array('+' => '.', '=' => '_', '/' => '~'));
     }
     return $ret;
 }
All Usage Examples Of CI_Encrypt::encode