Class: DataMapper::Property::APIKey
- Inherits:
-
String
- Object
- String
- DataMapper::Property::APIKey
- Defined in:
- lib/dm-types/api_key.rb
Constant Summary collapse
- PADDING =
The amount of random seed data to use to generate tha API Key
256
Class Method Summary collapse
-
.generate ⇒ String
Generates a new API Key.
Class Method Details
.generate ⇒ String
Generates a new API Key.
22 23 24 25 26 27 |
# 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 |