mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/securerandom.rb (random_bytes): call to_int method for the
argument at first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
34a8bfa971
commit
e76660caad
2 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Mon May 7 20:14:15 2012 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* lib/securerandom.rb (random_bytes): call to_int method for the
|
||||||
|
argument at first.
|
||||||
|
|
||||||
Mon May 7 17:54:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
Mon May 7 17:54:12 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* lib/minitest/unit.rb (assert_match): replace matcher only if both
|
* lib/minitest/unit.rb (assert_match): replace matcher only if both
|
||||||
|
|
|
@ -54,7 +54,7 @@ module SecureRandom
|
||||||
# If secure random number generator is not available,
|
# If secure random number generator is not available,
|
||||||
# NotImplementedError is raised.
|
# NotImplementedError is raised.
|
||||||
def self.random_bytes(n=nil)
|
def self.random_bytes(n=nil)
|
||||||
n ||= 16
|
n = n ? n.to_int : 16
|
||||||
|
|
||||||
if defined? OpenSSL::Random
|
if defined? OpenSSL::Random
|
||||||
@pid = 0 if !defined?(@pid)
|
@pid = 0 if !defined?(@pid)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue