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

doc: "Buffers and character encodings" issue regarding base64/base64url #39975

Open
1 task
robguinness-snyk opened this issue Sep 2, 2021 · 1 comment
Open
1 task
Labels
buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations.

Comments

@robguinness-snyk
Copy link

📗 API Reference Docs Problem

  • Version: v16.8.0 (possibly other versions as well)
  • Subsystem: Buffer / encodings

Location

Section of the site where the content exists

Affected URL(s):

Description

Concise explanation of the problem

The documentation for 'base64' and 'base64url' both reference RFC 4648, Section 5, but base64 and base64url are two distinct encodings, and the contents of Section 5 states "This encoding may be referred to as "base64url". This encoding should not be regarded as the same as the "base64" encoding and should not be referred to as only "base64". Unless clarified otherwise, "base64" refers to the base 64 in the previous section."

Because of this, it is unclear whether buf.toString('base64') returns base64 or base64url. If it indeed returns base64url, then it is unclear why 'base64url' exists as another encoding option.


  • I would like to work on this issue and
    submit a pull request.
@robguinness-snyk robguinness-snyk added the doc Issues and PRs related to the documentations. label Sep 2, 2021
@VoltrexKeyva
Copy link
Member

As the documentation for both of these encoding options read:
Screenshot_20210902-170535_Chrome
Both of them does reference RFC 4648, Section 5, but what to realize here is that the base64 encoding option tells you that it also accepts the "URL and Filename Safe Alphabet" specified specifically in the mentioned section, it doesn't reference that section to explain what exactly the base64 encoding is as a hyperlink has already been provided that leads to the actual explanation of the base64 encoding just above the hyperlink that leads to the section 5 of RFC 4648. That being said it doesn't refer to them being the same option.

The base64url encoding option however references the section 5 of RFC 4648 for a brief explanation of what this encoding exactly is and correctly refers to it as not being the same as the base64 encoding option.

For a difference between the 2 options, at the end of the base64url encoding option's description, it states that it omits the padding which the base64 encoding option doesn't.

@Mesteery Mesteery added the buffer Issues and PRs related to the buffer subsystem. label Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations.
Projects
None yet
Development

No branches or pull requests

3 participants