Generating a unique identifier is a good thing, and I see you want to improve randomness with the time/rand. Have you considered an UUID (e.g.: http://www.ruby-doc.org/stdlib-1.9.3/libdoc/securerandom/rdoc/SecureRandom.html#method-c-uuid)?