Converting to base64

S

scott

Hi all, trying to use base64. Ill get right to the problem.

I am converting a string into base 64. No problem there.
That base64 string can then be converted back to the orignal string. No
problem there.
The problem is, due to the nature of my program, i have to pad out the
base64 with '=''.
i know that a base64 string will some times use '=' it self to pad out the
base64 string but i have to add extra to it.
Now when i try to decode the base64 string with the added '=' on it i get an
exeption error.

"Invalid character in a Base-64 string."

i thought that the '=' was just padding so it would not matter if i added
extra onto it.

Can any one plz help ?

Thx Scott.
 
S

Steve Walker

scott said:
Hi all, trying to use base64. Ill get right to the problem.

I am converting a string into base 64. No problem there.
That base64 string can then be converted back to the orignal string. No
problem there.
The problem is, due to the nature of my program, i have to pad out the
base64 with '=''.
i know that a base64 string will some times use '=' it self to pad out the
base64 string but i have to add extra to it.
Now when i try to decode the base64 string with the added '=' on it i get an
exeption error.

"Invalid character in a Base-64 string."

i thought that the '=' was just padding so it would not matter if i added
extra onto it.

It is padding, but it's meaningful padding, and the amount of it
matters. You can't just stick an arbitrary chunk of it on the end.

See:

http://email.about.com/cs/standards/a/base64_encoding.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top