Y
Hacker News
new
|
ask
|
show
|
jobs
by
lacerus
4902 days ago
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)
1 comments
earless1
4902 days ago
http://www.ruby-doc.org/stdlib-1.9.3/libdoc/securerandom/rdo...
link