CoolBots
CoolBots

Reputation: 4889

Why base64 encode twice?

I've seen a few posts referencing double-encoded base64 strings (like this one and this one). Why is this technique necessary?

Upvotes: 4

Views: 3532

Answers (1)

hobbs
hobbs

Reputation: 240521

It's not necessary, it just happens sometimes. If system A encodes all of the data it gets, because it might be binary, and some of that data happens to come from system B, which already encoded its output as base64, then you get double-encoding. It's like asking "when I buy something online, why do I sometimes get a box inside a box?" Because the shipper puts everything into a box, even boxes.

Upvotes: 9

Related Questions