Skip to content

Instantly share code, notes, and snippets.

@karlwestin
Created November 29, 2011 12:12
Show Gist options
  • Save karlwestin/1404606 to your computer and use it in GitHub Desktop.
Save karlwestin/1404606 to your computer and use it in GitHub Desktop.
Generating 10000 random codes in ruby
require 'digest/sha1'
(1..10000).map {|n| (Digest::SHA1.hexdigest (n*rand).to_s)[1..8]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment