I am creating a pastebin application and want the paste IDs to be really random. /dev/randomon Linux (hosted on a Linux machine) uses noise, so the output is really random.
I am currently using this code to generate identifiers:
self.guid = Digest::SHA1.hexdigest(Time.new.to_s + (0...50).map{ ('a'..'z').to_a[rand(26)] }.join)
Does Ruby use a randfunction /dev/random, and if not, how can I use /dev/randomin Ruby? Thank.
user142019
source
share