Created
November 25, 2008 19:32
-
-
Save oleganza/29048 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
# 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