Method: Racket::Misc.randstring
- Defined in:
- lib/racket/misc/misc.rb
.randstring(size) ⇒ Object
Return a string that is at most size characters long
52 53 54 55 56 57 58 |
# File 'lib/racket/misc/misc.rb', line 52 def Misc.randstring(size) s = "" 0.upto(size-1) { s += sprintf("%c", randbytes(1)) } s end |