Tuesday, July 1, 2014

base64 encoding and decoding

There are numerous instances where we want to serialize or de-serialize our object. In order to do the same different type of serialization techniques are being user like binary serialization, xml serialization, json serialization.

Recently I came across base64 serialization. Using this approach you can serialize your object as a base64 text string which means your object will be converted into string of characters represented by string.

Also same set of string can be de-serialized back to object.

This serialization can be used where we are not sure of the transport medium or protocol which will be used to transfer the data. Since text are treated as text so its safe to send it as base64 encoded object.

Encoding defined how a character is stored on your hard disk. Mostly Unicode encoding is used since it defines all the characters any language can have under the sky. So if we are using UTF for decoding or encoding that means you are able to interpret that character and now just to show the same you need fonts of that language.

No comments:

Post a Comment