Skip to content

Instantly share code, notes, and snippets.

@oleganza
Created November 25, 2008 19:32
Show Gist options
  • Save oleganza/29048 to your computer and use it in GitHub Desktop.
Save oleganza/29048 to your computer and use it in GitHub Desktop.
# oleganza 25.11.2008
def total_srand!(srand_key = ENV['SRAND'])
srand_key = (srand_key || 42).to_i
srand(srand_key)
if defined?(UUID) # for uuidtools gem (uses /dev/random, /dev/urandom by default)
::UUID.instance_variable_set(:@random_device, :use_rand_please)
end
srand_key
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment