Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a Base64 String contain tabs?

Tags:

c#

.net

base64

Simple yes or no question, and I'm 90% sure that it is no... but I'm not sure.

Can a Base64 string contain tabs?

like image 805
Jason Avatar asked Nov 12 '08 21:11

Jason


People also ask

What characters are not allowed in Base64?

The base 64 digits in ascending order from zero are the uppercase characters 'A' to 'Z', lowercase characters 'a' to 'z', numerals '0' to '9', and the symbols '+' and '/'. % is not allowed in base64 encoding. Save this answer.

Can Base64 encoded string contain?

Base64 is a binary-to-text encoding scheme. It's represented as printable ASCII characters where each Base64 character contains 6 bits of binary information. It's very useful for storing image/audio information in Strings of information.

Can Base64 have line breaks?

Because line breaks are considered white-space characters in a base-64 encoding, they are ignored when converting a base-64 encoded string back to a byte array.

What characters can be in a Base64 string?

Base64 only contains A–Z , a–z , 0–9 , + , / and = . So the list of characters not to be used is: all possible characters minus the ones mentioned above. For special purposes . and _ are possible, too.


2 Answers

It depends on what you're asking. If you are asking whether or not tabs can be base-64 encoded, then the answer is "yes" since they can be treated the same as any other ASCII character.

However, if you are asking whether or not base-64 output can contain tabs, then the answer is no. The following link is for an article detailing base-64, including which characters are considered valid:

http://en.wikipedia.org/wiki/Base64

like image 155
Brian Avatar answered Sep 23 '22 06:09

Brian


The short answer is no - but Base64 cannot contain carriage returns either.

That is why, if you have multiple lines of Base64, you strip out any carriage returns, line feeds, and anything else that is not in the Base64 alphabet

That includes tabs.

like image 30
Ian Boyd Avatar answered Sep 21 '22 06:09

Ian Boyd