basE91 in Rails

I was checking out
It has: TODO: Add support for other encodings

So, I googled a bit and found this:

On initial investigation, this seems a pretty good alternative to base64

I feel this might be of good value to a lot of developers.

If you guys feel the same way, I will be more than happy to get started on this.

Thank you.



Is there any evidence that base91 is used “in the wild”? References to it are very light on Google etc; for instance, Wikipedia only mentions it as an “external link” on the Ascii85 page.

It’s also going to be tricky to embed in XML, since it uses several characters that XML reserves (<, &, > and ") which will require escaping. That appears to have been addressed in a variant ( which uses a different set of characters.

—Matt Jones


There is no evidence that it is being used a lot. But there is this, (< 100 downloads till now).

And this, a research paper,

Seems pretty interesting.

there is 7.7% (of
Base64’s encoded data) cut off in data traffic, transfer
time, transfer cost, at the same time there is saving our
society some energy, if employing Base91 instead of
Base64 as encoding for network data transfer with huge

We never know how much of a performance boost it provides or what downsides this has, unless we try it out ourselves.

Let me know what you guys think.

Warm regards,


I read and see the links, looks good to me, add support to base91 and you can choose, base64 is what everyone uses but I believe that is getting old.
It would be great to choose and the future remove once and for all the base64 , logical would have to test to see if you can not generate a problem.

Hi Sushruth,

Hello Federico,

Seems like a good first step.

But I just want to get a general idea, if this is something that the developers will use at all ?

Hello guys,

Following Federico’s advice, built a gem :

Usage is dead simple, Base91.encode(“data”)

I would love to hear your opinions and suggestions on this.

Warm regards,