We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1f08f53 + 6401ef5 commit 00d889bCopy full SHA for 00d889b
3 files changed
.gitignore
@@ -6,3 +6,4 @@
6
/pkg/
7
/spec/reports/
8
/tmp/
9
+Gemfile.lock
Gemfile
@@ -1,4 +1,4 @@
1
source "https://rubygems.org"
2
3
gem "rake"
4
-gem "minitest"
+gem "test-unit"
lib/base64.rb
@@ -99,9 +99,11 @@ def urlsafe_decode64(str)
99
# NOTE: RFC 4648 does say nothing about unpadded input, but says that
100
# "the excess pad characters MAY also be ignored", so it is inferred that
101
# unpadded input is also acceptable.
102
- str = str.tr("-_", "+/")
103
if !str.end_with?("=") && str.length % 4 != 0
104
str = str.ljust((str.length + 3) & ~3, "=")
+ str.tr!("-_", "+/")
105
+ else
106
+ str = str.tr("-_", "+/")
107
end
108
strict_decode64(str)
109
0 commit comments