Skip to content

Instantly share code, notes, and snippets.

@jarinudom
Created November 14, 2012 22:03
Show Gist options
  • Save jarinudom/4075144 to your computer and use it in GitHub Desktop.
Save jarinudom/4075144 to your computer and use it in GitHub Desktop.
#!/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