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: explain hex encoding in Buffer API #31352

Closed

Conversation

HarshithaKP
Copy link
Member

fixes: #29786
refs: #29792
refs: #24491

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations. labels Jan 14, 2020
doc/api/buffer.md Outdated Show resolved Hide resolved
doc/api/buffer.md Outdated Show resolved Hide resolved
doc/api/buffer.md Outdated Show resolved Hide resolved
doc/api/buffer.md Outdated Show resolved Hide resolved
// Prints <Buffer 1a>, data truncated when data ends in single digit ('7').

Buffer.from('1634', 'hex');
// Prints <Buffer 16 34>, fully qualified hexadecimal data
Copy link
Member

@Trott Trott Jan 16, 2020

Choose a reason for hiding this comment

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

Optional nit: Saying that the data was not truncated might be easier to understand than describing it as fully-qualified.

Suggested change
// Prints <Buffer 16 34>, fully qualified hexadecimal data
// Prints <Buffer 16 34>, all data represented.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Trott, thanks. Fixed it.

```js
Buffer.from('1ag', 'hex');
// Prints <Buffer 1a>, data truncated when first non-hexadecimal value
// ('g') encountered
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// ('g') encountered
// ('g') encountered.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Trott, ditto.

@Trott
Copy link
Member

Trott commented Jan 17, 2020

Landed in e43ee37

@Trott Trott closed this Jan 17, 2020
Trott pushed a commit that referenced this pull request Jan 17, 2020
fixes: #29786
refs: #29792
refs: #24491

PR-URL: #31352
Fixes: #29786
Refs: #29792
Refs: #24491
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
codebytere pushed a commit that referenced this pull request Feb 17, 2020
fixes: #29786
refs: #29792
refs: #24491

PR-URL: #31352
Fixes: #29786
Refs: #29792
Refs: #24491
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@codebytere codebytere mentioned this pull request Feb 17, 2020
codebytere pushed a commit that referenced this pull request Mar 14, 2020
fixes: #29786
refs: #29792
refs: #24491

PR-URL: #31352
Fixes: #29786
Refs: #29792
Refs: #24491
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
codebytere pushed a commit that referenced this pull request Mar 17, 2020
fixes: #29786
refs: #29792
refs: #24491

PR-URL: #31352
Fixes: #29786
Refs: #29792
Refs: #24491
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@codebytere codebytere mentioned this pull request Mar 17, 2020
@HarshithaKP HarshithaKP mentioned this pull request Apr 1, 2020
2 tasks
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
4 participants