Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Base64 encoding Allowed Characters

Tags:

java

base64

I'm using Base64 encoding for encoding user id field in Java.

String abc = new String(Base64.encodeBase64("Actualuseridfield")); 

I want to know whether the string abc above will contain the character " , : or not?

When the Base64 encoded string is returned in abc, will it ever contain below characters?

" <double quote>  , <comma>  : <colon> 
like image 952
Freephone Panwal Avatar asked May 21 '13 23:05

Freephone Panwal


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.

How many characters does Base64 have?

The Base64 Alphabet contains 64 basic ASCII characters which are used to encode data. Yeah, that's right, 64 characters is enough to encode any data of any length.

Does Base64 allow spaces?

By reading the http://en.wikipedia.org/wiki/Base64 wiki it seems that in Base64 transfer encoding for MIME (RFC 2045) spaces are allowed and discarded. In all other variants they are forbidden.

Can Base64 contain comma?

You will not see any commas, colons, or double quotes in a Base64 encoded string. You will see equals signs since they're used to pad the ending content.


1 Answers

You will not see any commas, colons, or double quotes in a Base64 encoded string. You will see equals signs since they're used to pad the ending content.

like image 65
Tap Avatar answered Sep 24 '22 04:09

Tap