Class: ReadableRandom
- Inherits:
-
Object
- Object
- ReadableRandom
- Defined in:
- lib/readable_random.rb
Constant Summary collapse
- EXCLUDE =
%w[o O 0 1 l / = +]
Class Method Summary collapse
Class Method Details
.get(size) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/readable_random.rb', line 6 def self.get(size) try = random_string(size * 2) try = try.split('').reject{|x| EXCLUDE.include? x}.join('') if try.length < size #too many excluded characters !? get(size) #try once again... else try[0...size] end end |