method

bytes

Importance_1
Ruby latest stable (v2_5_5) - 0 notes - Class: Random
bytes(p1) public

Returns a random binary string containing size bytes.

random_string = Random.new.bytes(10) # => "\xD7:R\xAB?\x83\xCE\xFAkO"
random_string.size                   # => 10
Show source
Register or log in to add new notes.