Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(std/encoding): add base91 module #6487

Closed
wants to merge 5 commits into from
Closed

Conversation

oplik0
Copy link
Contributor

@oplik0 oplik0 commented Jun 26, 2020

Custom implementation of base91 encoding based on http://base91.sourceforge.net/
It was also heavily influenced by existing base32 and base64 implementations in std/encoding.

Base91 is (as far as I know) most common ascii-only encoding above base85, providing a more efficient - both space-wise and performance-wise - way to store binary data as text. Compared to base64, base91 string should be between 7.7% to 14.3% smaller.

@CLAassistant
Copy link

CLAassistant commented Jun 26, 2020

CLA assistant check
All committers have signed the CLA.

I was thought I removed that comment before commiting...
@ry
Copy link
Member

ry commented Jun 29, 2020

Hi @oplik0 - Thanks for the patch. I've never heard of base91 before - interesting. Given that modules in std are intended to stick around forever, may I suggest that you first add this module to deno.land/x and let's see how popular it is? I'm hesitant to add support for an encoding I haven't heard of before.

oplik0 added a commit to oplik0/deno_website2 that referenced this pull request Jun 30, 2020
Recommended to be added here instead of `std/encoding` (at least for now) by @ry here: denoland/deno#6487

Implementation of [basE91](http://base91.sourceforge.net/) in Deno.
Base91 is (as far as I know) most common ascii-only encoding above base85, providing a more efficient - both space-wise and performance-wise - way to store binary data as text. Compared to base64, base91 string should be between 7.7% to 14.3% smaller.
@oplik0
Copy link
Contributor Author

oplik0 commented Jun 30, 2020

Well, I wasn't entirely sure if it fit here too, to be honest. I asked in #dev on discord but didn't get a response so decided to make the PR.

After thinking more about it I'd say that you're right, since while it seems to me to be superior to base85 - that encoding is far more popular and therefore more useful, and usually good enough. It's still 25% overhead instead of 33% of base64 (base91 is 23% in the worst case and only 14% in the best). And it's also not available in std/encoding, so I'll try to resolve that problem instead :)

@oplik0 oplik0 closed this Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants