module Base64
Support for encode 64 without n
Public Instance Methods
strict_decode64(str)
click to toggle source
Returns the Base64-decoded version of str
. This method complies with RFC 4648. ArgumentError is raised if str
is incorrectly padded or contains non-alphabet characters. Note that CR or LF are also rejected.
# File lib/lorj/compat.rb, line 96 def strict_decode64(str) str.unpack('m0').first end
strict_encode64(bin)
click to toggle source
Returns the Base64-encoded version of bin
. This method complies with RFC 4648. No line feeds are added.
# File lib/lorj/compat.rb, line 88 def strict_encode64(bin) [bin].pack('m0').strip end