Skip to content

Feature/base64 support #12

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

Merged
merged 4 commits into from
Jun 27, 2017
Merged

Feature/base64 support #12

merged 4 commits into from
Jun 27, 2017

Conversation

jeskew
Copy link
Contributor

@jeskew jeskew commented May 27, 2017

This PR adds cross-platform base64 support, since this isn't something built into the ES spec. In node, this functionality is provided by the buffer module, but we're on our own in browserland. For simplicity, this PR does not include support for URL-safe or unpadded b64, as that can be added as a post-processing step if we ever need it in an SDK.

@jeskew
Copy link
Contributor Author

jeskew commented Jun 21, 2017

This will need to be rebased after #11 is merged in.

Copy link
Contributor

@chrisradek chrisradek left a comment

Choose a reason for hiding this comment

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

Minor doc-related comment, otherwise shipit!

const bitsPerByte = 8;
const maxLetterValue = 0b111111;

export function fromBase64(input: string): Uint8Array {
Copy link
Contributor

Choose a reason for hiding this comment

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

Were these methods taken from somewhere, or was https://tools.ietf.org/html/rfc4648#section-4 used for the spec? We might want to add a comment reference to the spec for future devs (or in the README)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was based on the spec. I added some documentation blocks for each encoder, and the browser ones include a link to the IETF spec.

@chrisradek
Copy link
Contributor

:shipit:

@jeskew jeskew merged commit 3a6ae9f into aws:master Jun 27, 2017
@jeskew jeskew deleted the feature/base64-support branch July 13, 2017 00:55
trivikr referenced this pull request in trivikr/aws-sdk-js-v3 Dec 10, 2018
@lock
Copy link

lock bot commented Sep 26, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants