Skip to content

Instantly share code, notes, and snippets.

@tatat
Last active July 8, 2019 20:33
Show Gist options
  • Save tatat/4561989 to your computer and use it in GitHub Desktop.
Save tatat/4561989 to your computer and use it in GitHub Desktop.
require "digest/md5"
d = Digest::MD5.hexdigest("nyan" + Time.now.strftime("%Y%m%d")).to_i(16);
shindan = []
10.times {|n| shindan[n] = []; 99.times {|nn| shindan[n] << nn.to_s } }
result = []
shindan.each_with_index {|item, i|
srand(d + i)
result << item[rand(item.length)]
}
p result.join('-')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment