private function encode($data)
    {
        $rdm = $this->random();
        $data = base64_encode($data);
        $startIndex = rand(1, strlen($rdm));
        $params = base64_encode($startIndex).self::ENC_SEPARATOR;
        $params .= base64_encode(strlen($data)).self::ENC_SEPARATOR;

        return $params.substr_replace($rdm, $data, $startIndex, 0);
    }
private function encode($data)
    {
        $rdm = $this->random();
        $data = base64_encode($data);
        $startIndex = rand(1, strlen($rdm));
        $params = base64_encode($startIndex).self::ENC_SEPARATOR;
        $params .= base64_encode(strlen($data)).self::ENC_SEPARATOR;

        return $params.substr_replace($rdm, $data, $startIndex, 0);
    }
private function encode ( $ data ) { $ rdm = $ this -> random ( ) ; $ data = base64_encode ( $ data ) ; $ startIndex = rand ( 1 , strlen ( $ rdm ) ) ; $ params = base64_encode ( $ startIndex ) . self :: ENC_SEPARATOR ; $ params .= base64_encode ( strlen ( $ data ) ) . self :: ENC_SEPARATOR ; return $ params . substr_replace ( $ rdm , $ data , $ startIndex , 0 ) ; }
Encode data inside a random string.

@param string $data : the data to encode

@return string : the encoded data
Encode data inside a random string .