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.7 lib/graphql/schema/base_64_encoder.rb
graphql-2.1.6 lib/graphql/schema/base_64_encoder.rb
graphql-2.1.5 lib/graphql/schema/base_64_encoder.rb
graphql-2.1.4 lib/graphql/schema/base_64_encoder.rb
graphql-1.13.20 lib/graphql/schema/base_64_encoder.rb
graphql-2.1.3 lib/graphql/schema/base_64_encoder.rb
graphql-2.1.2 lib/graphql/schema/base_64_encoder.rb
graphql-2.1.1 lib/graphql/schema/base_64_encoder.rb
graphql-2.1.0 lib/graphql/schema/base_64_encoder.rb
graphql-2.0.27 lib/graphql/schema/base_64_encoder.rb
graphql-2.0.26 lib/graphql/schema/base_64_encoder.rb
graphql-2.0.25 lib/graphql/schema/base_64_encoder.rb
graphql-2.0.24 lib/graphql/schema/base_64_encoder.rb
graphql-2.0.23 lib/graphql/schema/base_64_encoder.rb
graphql-2.0.22 lib/graphql/schema/base_64_encoder.rb
graphql-2.0.21 lib/graphql/schema/base_64_encoder.rb
graphql-2.0.20 lib/graphql/schema/base_64_encoder.rb
graphql-2.0.17.2 lib/graphql/schema/base_64_encoder.rb
graphql-2.0.17.1 lib/graphql/schema/base_64_encoder.rb
graphql-2.0.19 lib/graphql/schema/base_64_encoder.rb