Module: Base64
- Defined in:
- opal/stdlib/base64.rb
Class Method Summary collapse
- .decode64(string) ⇒ Object
- .encode64(string) ⇒ Object
- .strict_decode64(string) ⇒ Object
- .strict_encode64(string) ⇒ Object
- .urlsafe_decode64(string) ⇒ Object
- .urlsafe_encode64(string) ⇒ Object
Class Method Details
.decode64(string) ⇒ Object
129 130 131 |
# File 'opal/stdlib/base64.rb', line 129 def self.decode64(string) `decode(string.replace(/\r?\n/g, ''))` end |
.encode64(string) ⇒ Object
133 134 135 |
# File 'opal/stdlib/base64.rb', line 133 def self.encode64(string) `encode(string).replace(/(.{60})/g, "$1\n")` end |
.strict_decode64(string) ⇒ Object
137 138 139 |
# File 'opal/stdlib/base64.rb', line 137 def self.strict_decode64(string) `decode(string)` end |
.strict_encode64(string) ⇒ Object
141 142 143 |
# File 'opal/stdlib/base64.rb', line 141 def self.strict_encode64(string) `encode(string)` end |
.urlsafe_decode64(string) ⇒ Object
145 146 147 |
# File 'opal/stdlib/base64.rb', line 145 def self.urlsafe_decode64(string) `decode(string.replace(/\-/g, '+').replace(/_/g, '/'))` end |
.urlsafe_encode64(string) ⇒ Object
149 150 151 |
# File 'opal/stdlib/base64.rb', line 149 def self.urlsafe_encode64(string) `encode(string).replace(/\+/g, '-').replace(/\//g, '_')` end |