Sha256: ab2cfeae7baa63007789a184515523749f56e92cca589748db02a562179e7181

Contents?: true

Size: 560 Bytes

Versions: 122

Compression:

Stored size: 560 Bytes

Contents

# frozen_string_literal: true

require 'graphql/schema/base_64_bp'

module GraphQL
  class Schema
    # @api private
    module Base64Encoder
      def self.encode(unencoded_text, nonce: false)
        Base64Bp.urlsafe_encode64(unencoded_text, padding: false)
      end

      def self.decode(encoded_text, nonce: false)
        # urlsafe_decode64 is for forward compatibility
        Base64Bp.urlsafe_decode64(encoded_text)
      rescue ArgumentError
        raise GraphQL::ExecutionError, "Invalid input: #{encoded_text.inspect}"
      end
    end
  end
end

Version data entries

122 entries across 122 versions & 2 rubygems

Version Path
graphql-1.12.5 lib/graphql/schema/base_64_encoder.rb
graphql-1.11.8 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.4 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.3 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.2 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.1 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.0 lib/graphql/schema/base_64_encoder.rb
graphql-1.11.7 lib/graphql/schema/base_64_encoder.rb
graphql-1.11.6 lib/graphql/schema/base_64_encoder.rb
graphql-1.11.5 lib/graphql/schema/base_64_encoder.rb
graphql-1.11.4 lib/graphql/schema/base_64_encoder.rb
graphql-1.11.3 lib/graphql/schema/base_64_encoder.rb
graphql-1.11.2 lib/graphql/schema/base_64_encoder.rb
graphql-1.10.14 lib/graphql/schema/base_64_encoder.rb
graphql-1.11.1 lib/graphql/schema/base_64_encoder.rb
graphql-1.10.13 lib/graphql/schema/base_64_encoder.rb
graphql-1.11.0 lib/graphql/schema/base_64_encoder.rb
graphql-1.10.12 lib/graphql/schema/base_64_encoder.rb
graphql-1.10.11 lib/graphql/schema/base_64_encoder.rb
graphql-1.10.10 lib/graphql/schema/base_64_encoder.rb