Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
lacerus
· 13y ago · 0 comments
to_hex does not seem to be in the standard library, but these will work and are rather elegant to get a short random string. Thanks, Patrick!
rand(16**16).to_s(16) rand(16**16).to_s(36)
Comments
[–]
earless1
13y ago
http://www.ruby-doc.org/stdlib-1.9.3/libdoc/securerandom/rdo...