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

buf.readUIntBE and buf.readUIntLE documentation examples are switched #8227

Closed
mozkeeler opened this issue Aug 22, 2016 · 3 comments
Closed
Labels
buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations.

Comments

@mozkeeler
Copy link
Contributor

  • Version: v6.4.0
  • Platform: Linux x260 4.6.5-200.fc23.x86_64 deps: update openssl to 1.0.1j #1 SMP Thu Jul 28 01:10:25 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem:

The documentation at https://nodejs.org/api/buffer.html#buffer_buf_readuintbe_offset_bytelength_noassert has a few examples, reproduced in part here:

const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);

// Prints: 1234567890ab
console.log(buf.readUIntLE(0, 6).toString(16));

// Prints: ab9078563412
console.log(buf.readUIntBE(0, 6).toString(16));

However, the comments describing the output are the opposite of what they should be. The LE example outputs "ab9078563412" whereas the BE example outputs "1234567890ab".

@mscdex mscdex added buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations. labels Aug 22, 2016
@addaleax
Copy link
Member

Hi @mozkeeler – do you maybe want to submit a pull request to address this yourself?

@mozkeeler
Copy link
Contributor Author

@addaleax: I created #8240 - let me know if that works :)

@jasnell
Copy link
Member

jasnell commented Aug 26, 2016

Fix landed! Closing!

@jasnell jasnell closed this as completed Aug 26, 2016
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

4 participants