module Base64
Public Class Methods
urlsafe_decode64(str)
click to toggle source
# File lib/proxy_authentication/cipher.rb, line 59 def self.urlsafe_decode64(str) str.tr("-_", "+/").unpack("m0").first end
urlsafe_encode64(bin)
click to toggle source
# File lib/proxy_authentication/cipher.rb, line 56 def self.urlsafe_encode64(bin) [bin].pack("m0").tr("+/", "-_") end