Soluling home   Document home

Binary

Binary data encoded into a string

Text-based formats (e.g. text file, XML, or JSON) were designed to store strings. Recently there is more and more demand storing binary data as well inside text files. For example, a file would need to contain images, audio, or encrypted data. This is where you use binary data encoding. There are several ways to encoding binary data into a string. Soluling supports the most commonly used encodings.

Base64

Base64 (Wikipedia) is the most common binary encoding used when storing binary data into a string. It uses four bytes to store three bytes making it using 33% more space than the binary format. For most applications, a 33% increase is very acceptable. If a text parser supports binary encoding, the change that it supports base64 is highest. You should always use base64 when storing binary data inside a string. Soluling supports base64 encoded data.

Base32

Base32 (Wikipedia) uses eight bytes to store five bytes. It uses 60% more space than the binary format. Base32 is less efficient than base64, but it has a few advantages that make it quite popular. Soluling supports base32 encoded data.

Base16/Hex encoding

Base16 (Wikipedia) uses two bytes to store one byte. The encoding is sometimes called hex encoding. It uses twice the space compared to the binary format. Base16 is less efficient than base64 and base32, but because it is very simple to encode and decode, it is commonly used. Soluling supports base16 encoded data.

URL encoding

URL encoding (Wikipedia) uses either one bytes or three bytes to store one byte. On average, it uses more than twice the space compared to the binary format. Even it is space inefficient, it is sometimes used because encoded strings are URL compatible.

Base85/Ascii85

Base85 (Wikipedia) uses marginally less memory than base64. However, the difference is not that significant (about 7%). In addition, the encoding is complex, and it is not compatible with XML and JSON files. Because of these disadvantages, base85 is a lot less used than base64. Very few applications support it. This is why Soluling does not either support base85. You should use base64 instead.