Sha256: 552e0ba34b5baa2de018b9b25438b80346eed149fc33fbf8d5f2057fac6b2918

Contents?: true

Size: 519 Bytes

Versions: 3

Compression:

Stored size: 519 Bytes

Contents

# frozen_string_literal: true

require "ob64"
require "base64"

module Ob64
  module CoreExt
    def strict_encode64(bin)
      Ob64.strictier_encode(bin)
    end

    def strict_decode64(str)
      Ob64.strictier_decode(str)
    end

    def urlsafe_encode64(bin, padding: true)
      Ob64.urlsafe_encode(bin, padding: padding)
    end

    def urlsafe_decode64(str)
      Ob64.urlsafe_decode(str)
    end
  end

  ::Base64.prepend(CoreExt)
  ::Base64.singleton_class.prepend(CoreExt)

  private_constant :CoreExt
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ob64-0.5.0 lib/ob64/core_ext.rb
ob64-0.4.0 lib/ob64/core_ext.rb
ob64-0.3.0 lib/ob64/core_ext.rb