Module: Nanoid
- Defined in:
- lib/nanoid.rb
Constant Summary collapse
- SAFE_ALPHABET =
'_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
Class Method Summary collapse
Class Method Details
.generate(size: 21, alphabet: SAFE_ALPHABET, non_secure: false) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/nanoid.rb', line 8 def self.generate(size: 21, alphabet: SAFE_ALPHABET, non_secure: false) return non_secure_generate(size: size, alphabet: alphabet) if non_secure return simple_generate(size: size) if alphabet == SAFE_ALPHABET complex_generate(size: size, alphabet: alphabet) end |