module Bundler::Random::Formatter
def hex(n=nil)
prng = Random.new
# or
Random.hex #=> "eb693ec8252cd630102fd0d0fb7c3485"
require 'bundler/vendor/securerandom/lib/random/formatter'
The result may contain 0-9 and a-f.
It may be larger in the future.
If _n_ is not specified or is nil, 16 is assumed.
The length of the resulting hexadecimal string is twice of _n_.
The argument _n_ specifies the length, in bytes, of the random number to be generated.
Generate a random hexadecimal string.
def hex(n=nil) random_bytes(n).unpack1("H*") end