Skip to content

Base64.decode64 isn't working as MRI implementation #2815

Description

@Myuzu
# ruby 2.2.1p85
Base64.encode64 "some_string"
"c29tZV9zdHJpbmc=\n"

Base64.decode64 "c29tZV9zdHJpbmc"
"some_string"

Base64.urlsafe_decode64 "c29tZV9zdHJpbmc"
ArgumentError: invalid base64

Base64.strict_decode64 "c29tZV9zdHJpbmc"
ArgumentError: invalid base64
# jruby 1.7.19 (2.0.0p598)
Base64.encode64 "some_string"
"c29tZV9zdHJpbmc=\n"

Base64.decode64 "c29tZV9zdHJpbmc"
"some_stri"

Base64.urlsafe_decode64 "c29tZV9zdHJpbmc"
"some_stri"

Base64.strict_decode64 "c29tZV9zdHJpbmc"
"some_stri"

I saw #2551 issue so some of these were fixed, but what about Base64.decode64? Should it return some_string or some_stri if I remove padding from encoded string?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions