Sha256: c84df939e5832e282c59c1da5ba308321ac7918002edff51f620726c57f5ea85

Contents?: true

Size: 334 Bytes

Versions: 189

Compression:

Stored size: 334 Bytes

Contents

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

Version data entries

189 entries across 189 versions & 7 rubygems

Version Path
msgpack-1.3.0-x86-mingw32 spec/random_compat.rb
msgpack-1.3.0-java spec/random_compat.rb
msgpack-1.3.0 spec/random_compat.rb
msgpack-1.2.10-java spec/random_compat.rb
msgpack-1.2.10-x64-mingw32 spec/random_compat.rb
msgpack-1.2.10-x86-mingw32 spec/random_compat.rb
msgpack-1.2.10 spec/random_compat.rb
msgpack-1.2.9-x64-mingw32 spec/random_compat.rb
msgpack-1.2.9-x86-mingw32 spec/random_compat.rb
msgpack-1.2.9-java spec/random_compat.rb
msgpack-1.2.9 spec/random_compat.rb
msgpack-1.2.8-java spec/random_compat.rb
msgpack-1.2.8-x64-mingw32 spec/random_compat.rb
msgpack-1.2.8-x86-mingw32 spec/random_compat.rb
msgpack-1.2.8 spec/random_compat.rb
msgpack-1.2.7-x64-mingw32 spec/random_compat.rb
msgpack-1.2.7-x86-mingw32 spec/random_compat.rb
msgpack-1.2.7-java spec/random_compat.rb
msgpack-1.2.7 spec/random_compat.rb
msgpack-1.2.6-java spec/random_compat.rb