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 ascii85 module #6711

Merged
merged 3 commits into from
Jul 14, 2020
Merged

feat(std/encoding): add ascii85 module #6711

merged 3 commits into from
Jul 14, 2020

Conversation

oplik0
Copy link
Contributor

@oplik0 oplik0 commented Jul 11, 2020

Custom implementation of ascii85 supporting multiple standards. Defaults to Adobe variant with no delimeter, since it's used by the Go standard library implementation (and probably most popular).

Additionally it can use btoa version, which can compress a couple characters more (four "spaces", that is bytes equal to 32, compress into a single "y" character), though there is no support for checksums added by btoa program at the end of a message with delimeters.

Since both of these can be hard to use in a string literal - since their characterset contains characters that need to be escaped (for example both quotation mark characters - ' and ") there are also two standards that should be safer to use - Z85 and RFC 1924 (while it's an April Fools' Day RFC and the standard is not the best idea for storing IPv6, the characterset used by this encoding is better for use in string literals since it excludes characters that might need to be escaped in JS/TS).

There is also support for adding delimeters in the encode function - <~ and ~> for Adobe variant and xbota Begin and xbtoa End for btoa. Other standards don't define any delimeter, so none is used even if the option is specified.

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet - LGTM.

@ry ry merged commit e5724e6 into denoland:master Jul 14, 2020
@oplik0 oplik0 deleted the base85 branch July 14, 2020 22:15
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 21, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Feb 1, 2021
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