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
hx_cbor-2024.7.7 spec/random_compat.rb
cbor-0.5.9.8 spec/random_compat.rb
cbor-0.5.9.7 spec/random_compat.rb
msgpack-1.6.0 spec/random_compat.rb
msgpack-1.5.6 spec/random_compat.rb
msgpack-1.5.5 spec/random_compat.rb
msgpack-1.5.4 spec/random_compat.rb
msgpack-1.5.3 spec/random_compat.rb
msgpack-1.5.2 spec/random_compat.rb
msgpack-1.5.1 spec/random_compat.rb
msgpack-1.5.0 spec/random_compat.rb
msgpack-1.4.5 spec/random_compat.rb
msgpack-1.4.4 spec/random_compat.rb
msgpack-1.4.4.pre1-java spec/random_compat.rb
msgpack-1.4.3 spec/random_compat.rb
msgpack-1.4.3-java spec/random_compat.rb
hx_cbor-2021.8.20 spec/random_compat.rb
msgpack-1.4.2-java spec/random_compat.rb
msgpack-1.4.2 spec/random_compat.rb
msgpack-1.4.1-java spec/random_compat.rb