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-2.1.13 lib/graphql/schema/base_64_encoder.rb
graphql-2.0.31 lib/graphql/schema/base_64_encoder.rb
graphql-1.13.23 lib/graphql/schema/base_64_encoder.rb
graphql-2.0.29 lib/graphql/schema/base_64_encoder.rb
graphql-2.1.12 lib/graphql/schema/base_64_encoder.rb
graphql-1.13.22 lib/graphql/schema/base_64_encoder.rb
graphql-2.2.7 lib/graphql/schema/base_64_encoder.rb
graphql-2.2.6 lib/graphql/schema/base_64_encoder.rb
graphql-2.1.11 lib/graphql/schema/base_64_encoder.rb
graphql-2.0.28 lib/graphql/schema/base_64_encoder.rb
graphql-1.13.21 lib/graphql/schema/base_64_encoder.rb
graphql-2.2.5 lib/graphql/schema/base_64_encoder.rb
graphql-2.2.4 lib/graphql/schema/base_64_encoder.rb
graphql-2.2.3 lib/graphql/schema/base_64_encoder.rb
graphql-2.1.10 lib/graphql/schema/base_64_encoder.rb
graphql-2.2.2 lib/graphql/schema/base_64_encoder.rb
graphql-2.1.9 lib/graphql/schema/base_64_encoder.rb
graphql-2.2.1 lib/graphql/schema/base_64_encoder.rb
graphql-2.2.0 lib/graphql/schema/base_64_encoder.rb
graphql-2.1.8 lib/graphql/schema/base_64_encoder.rb