module Bundler::Random::Formatter
def base64(n=nil)
prng.base64 #=> "6BbW0pxO0YENxn38HMUbcQ=="
prng = Random.new
# or
Random.base64 #=> "/2BuBuLf3+WfSKyQbRcc/A=="
require 'bundler/vendor/securerandom/lib/random/formatter'
The result may contain A-Z, a-z, 0-9, "+", "/" and "=".
It may be larger in the future.
If _n_ is not specified or is nil, 16 is assumed.
to be generated. The length of the result string is about 4/3 of _n_.
The argument _n_ specifies the length, in bytes, of the random number
Generate a random base64 string.
def base64(n=nil) [random_bytes(n)].pack("m0") end