mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
0ebbab23ba
commit
900e0c8c39
2 changed files with 3 additions and 3 deletions
|
|
@ -71,7 +71,7 @@ module Random::Formatter
|
|||
# prng.hex #=> "eb693ec8252cd630102fd0d0fb7c3485"
|
||||
# prng.hex #=> "91dc3bfb4de5b11d029d376634589b61"
|
||||
def hex(n=nil)
|
||||
random_bytes(n).unpack("H*")[0]
|
||||
random_bytes(n).unpack1("H*")
|
||||
end
|
||||
|
||||
# Random::Formatter#base64 generates a random base64 string.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue