CI_Encrypt::_xor_merge PHP Method

_xor_merge() protected method

Takes a string and key as input and computes the difference using XOR
protected _xor_merge ( $string, $key ) : string
return string
    protected function _xor_merge($string, $key)
    {
        $hash = $this->hash($key);
        $str = '';
        for ($i = 0, $ls = strlen($string), $lh = strlen($hash); $i < $ls; $i++) {
            $str .= $string[$i] ^ $hash[$i % $lh];
        }
        return $str;
    }