Module: Authlogic::Random
- Defined in:
- lib/authlogic/random.rb
Overview
Generates random strings using ruby’s SecureRandom library.
Class Method Summary collapse
- 
  
    
      .friendly_token  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Returns a string in base64url format as defined by RFC-3548 and RFC-4648. 
- .hex_token ⇒ Object
Class Method Details
.friendly_token ⇒ Object
Returns a string in base64url format as defined by RFC-3548 and RFC-4648. We call this a “friendly” token because it is short and safe for URLs.
| 12 13 14 | # File 'lib/authlogic/random.rb', line 12 def self.friendly_token SecureRandom.urlsafe_base64(15) end | 
.hex_token ⇒ Object
| 6 7 8 | # File 'lib/authlogic/random.rb', line 6 def self.hex_token SecureRandom.hex(64) end |