Module: Utilities::RandomToken

Defined in:
lib/utilities/random_token.rb

Class Method Summary collapse

Class Method Details

.digest(token) ⇒ Digest::SHA1

Parameters:

  • token (String)

Returns:

  • (Digest::SHA1)

9
10
11
# File 'lib/utilities/random_token.rb', line 9

def self.digest(token)
  Digest::SHA1.hexdigest(token.to_s)
end

.generateString

Returns:

  • (String)

3
4
5
# File 'lib/utilities/random_token.rb', line 3

def self.generate
  SecureRandom.urlsafe_base64
end