Module: Authtools::Common
Instance Method Summary collapse
-
#salt ⇒ Object
Generates a psuedo-random 64 character string.
Instance Method Details
#salt ⇒ Object
Generates a psuedo-random 64 character string.
5 6 7 8 9 |
# File 'lib/authtools/common.rb', line 5 def salt salt = "" 64.times { salt << (i = Kernel.rand(62); i += ((i < 10) ? 48 : ((i < 36) ? 55 : 61 ))).chr } salt end |