Module: ActiveLdap::UserPassword::Salt — activeldap - ActiveLdap

Module: ActiveLdap::UserPassword::Salt

Defined in:
lib/active_ldap/user_password.rb

Constant Summary

CHARS =
['.', '/'] + ['0'..'9', 'A'..'Z', 'a'..'z'].collect do |x|
  x.to_a
end.flatten

Class Method Summary (collapse)

Class Method Details

+ (Object) generate(length)



92
93
94
95
96
# File 'lib/active_ldap/user_password.rb', line 92

def generate(length)
  salt = ""
  length.times {salt << CHARS[rand(CHARS.length)]}
  salt
end