summaryrefslogtreecommitdiff
path: root/lib/base64.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/base64.rb')
-rw-r--r--lib/base64.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/base64.rb b/lib/base64.rb
index 24f0b02966c..5c8df841f16 100644
--- a/lib/base64.rb
+++ b/lib/base64.rb
@@ -81,8 +81,9 @@ module Base64
# Note that the result can still contain '='.
# You can remove the padding by setting +padding+ as false.
def urlsafe_encode64(bin, padding: true)
- str = strict_encode64(bin).tr("+/", "-_")
- str = str.delete("=") unless padding
+ str = strict_encode64(bin)
+ str.tr!("+/", "-_")
+ str.delete!("=") unless padding
str
end