Sha256: 1f5234b680f2aa89d6cf1d3ad5a9f4abb63e8a9fccededfbb585939b71693f09

Contents?: true

Size: 383 Bytes

Versions: 11

Compression:

Stored size: 383 Bytes

Contents

Base64.class_eval do
  def strict_encode64(bin)
    encode64(bin).tr("\n",'')
  end

  def strict_decode64(str)
    unless str.include?("\n")
      decode64(str)
    else
      raise(ArgumentError,"invalid base64")
    end
  end

  def urlsafe_encode64(bin)
    strict_encode64(bin).tr("+/", "-_")
  end

  def urlsafe_decode64(str)
    strict_decode64(str.tr("-_", "+/"))
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
legacy-fernet-1.6.4 lib/shim/base64.rb
legacy-fernet-1.6.3 lib/shim/base64.rb
legacy-fernet-1.6.2 lib/shim/base64.rb
legacy-fernet-1.6.1 lib/shim/base64.rb
fernet_multi_json-1.6 lib/shim/base64.rb
fernet-1.6 lib/shim/base64.rb
fernet-1.5 lib/shim/base64.rb
fernet-1.4 lib/shim/base64.rb
fernet-1.3 lib/shim/base64.rb
fernet-1.2 lib/shim/base64.rb
fernet-1.1 lib/shim/base64.rb