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

result of Buffer.from with base64 is different between versions #651

Closed
rapidia opened this issue Jun 1, 2017 · 3 comments
Closed

result of Buffer.from with base64 is different between versions #651

rapidia opened this issue Jun 1, 2017 · 3 comments

Comments

@rapidia
Copy link

rapidia commented Jun 1, 2017

  • Node.js Version: v6.10.3
  • OS: MacOS 10.12.5
  • Scope (install, code, runtime, meta, other?): other
  • Module (and version) (if relevant):
Buffer.from("It's weirdest I've Ever Seen!!", "base64")
// in v6.10.1 result is 
// <Buffer 22 db 30 7a 2a dd 7a cb 48 bd e1 2f 7a b4 9e 7a 7f>
// in v6.10.3 result is 
// <Buffer 22 db 30 7a 2a dd 7a cb 48 bd e1 2f 7a b4 9e 7a>
@vsemozhetbyt
Copy link

Some more versions I have:

  // Node.js 4.8.3 (v8 4.5.103.47) x64
<Buffer 22 db 30 7a 2a dd 7a cb 48 bd e1 2f 7a b4 9e 7a>
  // Node.js 6.10.3 (v8 5.1.281.101) x64
<Buffer 22 db 30 7a 2a dd 7a cb 48 bd e1 2f 7a b4 9e 7a>
  // Node.js 7.10.0 (v8 5.5.372.43) x64
<Buffer 22 db 30 7a 2a dd 7a cb 48 bd e1 2f 7a b4 9e 7a>
  // Node.js 8.0.0-nightly201703249ff7ed23cd (v8 5.6.326.57) x64
<Buffer 22 db 30 7a 2a dd 7a cb 48 bd e1 2f 7a b4 9e 7a 7f>
  // Node.js 8.0.0-nightly2017050673d9c0f903 (v8 5.7.492.69) x64
<Buffer 22 db 30 7a 2a dd 7a cb 48 bd e1 2f 7a b4 9e 7a>
  // Node.js 8.0.0 (v8 5.8.283.41) x64
<Buffer 22 db 30 7a 2a dd 7a cb 48 bd e1 2f 7a b4 9e 7a>
  // Node.js 8.0.0-test201704119b43f9c487 (v8 5.9.0 (candidate)) x64
<Buffer 22 db 30 7a 2a dd 7a cb 48 bd e1 2f 7a b4 9e 7a 7f>
  // Node.js 8.0.0-pre (v8 6.0.153) x64
<Buffer 22 db 30 7a 2a dd 7a cb 48 bd e1 2f 7a b4 9e 7a>

cc @nodejs/buffer

@RReverser
Copy link
Member

Hmm, does this matter in cases with invalid base64 anyway?

@addaleax
Copy link
Member

addaleax commented Jun 1, 2017

I think this is due to nodejs/node#11995? It’s intentional and should be a real bug fix.

Hmm, does this matter in cases with invalid base64 anyway?

We’re kind of lenient when it comes to decoding base64, but I agree; if you are passing strings like It's weirdest I've Ever Seen!! to the decoder, I wouldn’t expect a meaningful result.

@rapidia rapidia closed this as completed Feb 28, 2018
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

No branches or pull requests

4 participants