D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
td-agent
/
embedded
/
lib
/
ruby
/
gems
/
2.1.0
/
gems
/
msgpack-1.1.0
/
spec
/
Filename :
random_compat.rb
back
Copy
unless defined? Random class Random def initialize(seed=Time.now.to_i) Kernel.srand(seed) @seed = seed end attr_reader :seed def rand(arg) Kernel.rand(arg) end def bytes(n) array = [] n.times do array << rand(256) end array.pack('C*') end end end