Skip to content

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

Closed

Description

@rapidia
  • 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>

Activity

  1. vsemozhetbyt commented on Jun 1, 2017

    @vsemozhetbyt

    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

  2. RReverser commented on Jun 1, 2017

    @RReverser
    Member

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

  3. addaleax commented on Jun 1, 2017

    @addaleax
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions