Module: GraphQL::Query::Fingerprint Private
- Defined in:
- lib/graphql/query/fingerprint.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
-
.generate(input_str) ⇒ String
private
Make an obfuscated hash of the given string (either a query string or variables JSON).
Class Method Details
.generate(input_str) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Make an obfuscated hash of the given string (either a query string or variables JSON)
13 14 15 16 17 18 19 20 21 |
# File 'lib/graphql/query/fingerprint.rb', line 13 def self.generate(input_str) # Implemented to be: # - Short (and uniform) length # - Stable # - Irreversibly Opaque (don't want to leak variable values) # - URL-friendly bytes = Digest::SHA256.digest(input_str) Base64.urlsafe_encode64(bytes) end |