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.22 lib/graphql/schema/base_64_encoder.rb
graphql-1.13.0 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.21 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.20 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.19 lib/graphql/schema/base_64_encoder.rb
graphql-1.11.10 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.18 lib/graphql/schema/base_64_encoder.rb
graphql-1.11.9 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.17 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.16 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.15 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.14 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.13 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.12 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.11 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.10 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.9 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.8 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.7 lib/graphql/schema/base_64_encoder.rb
graphql-1.12.6 lib/graphql/schema/base_64_encoder.rb