Class: Integer
- Inherits:
-
Object
- Object
- Integer
- Defined in:
- lib/universa_tools/commons.rb
Instance Method Summary collapse
Instance Method Details
#random_alnums ⇒ Object
160 161 162 |
# File 'lib/universa_tools/commons.rb', line 160 def random_alnums to_i.times.map { UniversaTools::Commons::ALNUMS.sample }.join('') end |
#random_bytes ⇒ Object
168 169 170 |
# File 'lib/universa_tools/commons.rb', line 168 def random_bytes to_i.times.map { rand(256).chr }.join('').force_encoding('binary') end |
#random_digits ⇒ Object
164 165 166 |
# File 'lib/universa_tools/commons.rb', line 164 def random_digits to_i.times.map { UniversaTools::Commons::NUMBERS.sample }.join('') end |