Created
November 14, 2012 22:03
-
-
Save jarinudom/4075144 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby -w | |
require 'digest/md5' | |
filename = 'myimage.png' | |
# Generate a hash from the file contents | |
digest = Digest::MD5.hexdigest(File.read(filename)) | |
# Mersenne Twister RNG with seed | |
prng = Random.new(digest) | |
# Generate numbers | |
strength = prng.integer(20) | |
agility = prng.integer(20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment