Module: BunBun::Base64

Defined in:
lib/bunbun/base64.rb

Class Method Summary collapse

Class Method Details

.encode(string) ⇒ Object



4
5
6
7
8
9
# File 'lib/bunbun/base64.rb', line 4

def self.encode(string)
  str = [string].pack('m0')
  str.chomp!('==') or str.chomp!('=')
  str.tr!('+/', '-_')
  str
end