Parent

Methods

DataMapper::Property::APIKey

Constants

PADDING

The amount of random seed data to use to generate tha API Key

Public Class Methods

generate() click to toggle source

Generates a new API Key.

@return [String]

The new API Key.
# File lib/dm-types/api_key.rb, line 22
def self.generate
  sha1 = Digest::SHA1.new

  PADDING.times { sha1 << rand(256).chr }
  return sha1.hexdigest
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.