[ up | introduction · alphabet · comparison · license · download · screenshot · links ]

basE91 encoding

introduction

basE91 is an advanced method for encoding binary data as ASCII characters. It is similar to UUencode or base64, but is more efficient. The overhead produced by basE91 depends on the input data. It amounts at most to 23% (versus 33% for base64) and can range down to 14%, which typically occurs on 0-byte blocks. This makes basE91 very useful for transferring larger files over binary unsafe connections like e-mail or terminal lines.

alphabet

As the name suggests, basE91 needs 91 characters to represent the encoded binary data in ASCII. From the 94 printable ASCII characters (0x21-0x7E), the following three ones have been omitted to build the basE91 alphabet:

- (dash, 0x2D)
\ (backslash, 0x5C)
' (apostrophe, 0x27)

The translation table is composed of the remaining characters as shown below.

0A0x41 13N0x4E 26a0x61 39n0x6E 5200x30 65%0x25 78>0x3E
1B0x4214O0x4F27b0x6240o0x6F5310x3166&0x2679?0x3F
2C0x4315P0x5028c0x6341p0x705420x3267(0x2880@0x40
3D0x4416Q0x5129d0x6442q0x715530x3368)0x2981[0x5B
4E0x4517R0x5230e0x6543r0x725640x3469*0x2A82]0x5D
5F0x4618S0x5331f0x6644s0x735750x3570+0x2B83^0x5E
6G0x4719T0x5432g0x6745t0x745860x3671,0x2C84_0x5F
7H0x4820U0x5533h0x6846u0x755970x3772.0x2E85`0x60
8I0x4921V0x5634i0x6947v0x766080x3873/0x2F86{0x7B
9J0x4A22W0x5735j0x6A48w0x776190x3974:0x3A87|0x7C
10K0x4B23X0x5836k0x6B49x0x7862!0x2175;0x3B88}0x7D
11L0x4C24Y0x5937l0x6C50y0x7963#0x2376<0x3C89~0x7E
12M0x4D25Z0x5A38m0x6D51z0x7A64$0x2477=0x3D90"0x22

comparison

The table below shows a comparison of base64 and basE91, each method applied to 1 MiB binary data. The plain row lists the results with unformatted output and the MIME values show the amount of data that is produced, when you attach a file to an email (MIME requires a line break <CR><LF> after 76 characters).

binarybase64basE91
worst caserandom databest case
plain1048576 Byte
=1024 KiB
100%
1398104 Byte
+341 KiB
133.33%
1290556 Byte
+236 KiB
123.08%
1289478 Byte
+235 KiB
122.97%
1198373 Byte
+146 KiB
114.29%
MIME1434898 Byte
+377 KiB
136.84%
1324518 Byte
+269 KiB
126.32%
1323412 Byte
+268 KiB
126.21%
1229911 Byte
+177 KiB
117.29%

Using basE91 you need to transfer only 85.7% to 92.3% of the data, you would have to transfer with base64.

license

basE91 has been developed by Joachim Henke, and is released as free software under the terms of the BSD license.

download

Source code package (C, Java, PHP, 8086 assembly, AWK): base91-0.6.0.tar.gz (15 KiB)

Pre-compiled binaries for
GNU/Linux: base91-0.6.0-linux-i386.tar.gz (7 KiB),
Mac OS X: base91-0.6.0-osx-universal.tar.gz (11 KiB)

Java byte code: base91.jar (4 KiB)
To generate an e-mail attachment, run java -jar base91.jar file.dat, which encodes file.dat to pure ASCII data and writes this output to file.dat_b91.txt. Type java -jar base91.jar -h for all options, and read the included README file for further information.

screenshot

basE91 command line tool

links

SourceForge.net project page
freshmeat.net project page

SourceForge.net Logo

Valid XHTML 1.1Valid CSSW3C Recommendation © 2005-2013 Joachim Henke
last modified: 2013-06-07