Skip to content

Instantly share code, notes, and snippets.

@markuman
Created October 1, 2015 19:31
Show Gist options
  • Save markuman/6fc5011710385d2f0caf to your computer and use it in GitHub Desktop.
Save markuman/6fc5011710385d2f0caf to your computer and use it in GitHub Desktop.
Nine Nine Nine 2/4
127.0.0.1:6379> eval 'local seed = redis.call("TIME") return seed[1] .. "." .. seed[2]' 0
"1443727915.340182"
127.0.0.1:6379> eval 'local seed = redis.call("TIME") math.randomseed(tonumber(seed[1] .. "." .. seed[2])) return string.format("%f", math.random())' 0
"0.743658"
127.0.0.1:6379> eval 'local seed = redis.call("TIME") math.randomseed(tonumber(seed[1] .. "." .. seed[2])) return string.format("%f", math.random())' 0
"0.580878"
127.0.0.1:6379> eval 'local seed = redis.call("TIME") math.randomseed(tonumber(seed[1] .. "." .. seed[2])) return string.format("%f", math.random())' 0
"0.451681"
-- local seed = redis.call("TIME")
-- math.randomseed(tonumber(seed[1] .. "." .. seed[2]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment