Module: Base64

Defined in:
lib/proxy_authentication/cipher.rb

Class Method Summary collapse

Class Method Details

.urlsafe_decode64(str) ⇒ Object



59
60
61
# File 'lib/proxy_authentication/cipher.rb', line 59

def self.urlsafe_decode64(str)
  str.tr("-_", "+/").unpack("m0").first
end

.urlsafe_encode64(bin) ⇒ Object



56
57
58
# File 'lib/proxy_authentication/cipher.rb', line 56

def self.urlsafe_encode64(bin)
  [bin].pack("m0").tr("+/", "-_")
end