Class: Refinery::AuthKey
- Inherits:
-
Object
- Object
- Refinery::AuthKey
- Defined in:
- lib/refinery/auth_key.rb
Class Method Summary collapse
-
.make_auth_key(seed = '') ⇒ Object
———————————————————————— make_auth_key – returns a SHA-encrypted randomized key from time & seed ————————————————————————.
-
.make_token ⇒ Object
———————————————————————— ————————————————————————.
-
.secure_digest(*args) ⇒ Object
———————————————————————— ————————————————————————.
Class Method Details
.make_auth_key(seed = '') ⇒ Object
make_auth_key – returns a SHA-encrypted randomized key from time & seed
30 31 32 |
# File 'lib/refinery/auth_key.rb', line 30 def self.make_auth_key( seed='' ) return Digest::SHA1.hexdigest( (Time.now.to_s + seed.to_s ).split(//).sort_by {rand}.join ) end |
.make_token ⇒ Object
23 24 25 |
# File 'lib/refinery/auth_key.rb', line 23 def self.make_token secure_digest(Time.now, (1..10).map{ rand.to_s }) end |
.secure_digest(*args) ⇒ Object
17 18 19 |
# File 'lib/refinery/auth_key.rb', line 17 def self.secure_digest(*args) Digest::SHA1.hexdigest(args.flatten.join('--')) end |