Module: Tanshuku::Configuration::DefaultUrlHasher

Defined in:
lib/tanshuku/configuration.rb

Overview

The default object to hash a URL. Calls Digest::SHA512.hexdigest.

Class Method Summary collapse

Class Method Details

.call(url, namespace:) ⇒ String

Calls Digest::SHA512.hexdigest with the given URL string and the given namespace.

Parameters:

  • url (String)

    A URL to hash.

  • namespace (String)

    A namespace for the URL’s uniqueness.

Returns:

  • (String)

    A SHA512 digest string from the given url and namespace.



17
18
19
# File 'lib/tanshuku/configuration.rb', line 17

def self.call(url, namespace:)
  Digest::SHA512.hexdigest("#{namespace}#{url}")
end