Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
SecureRandom.random_number doesn't accept a range #4607
The problem is here:
At some point, the code to handle ranges was removed.
jruby 126.96.36.199 (2.3.1) 2017-03-06 90fc7ab Java HotSpot(TM) 64-Bit Server VM 25.121-b13 on 1.8.0_121-b13 +jit [mswin32-x86_64]
Windows 10 Professional x64
In standard Ruby I can do
If I do this in JRuby, I get an argument error for using a Range in place of a Fixnum.
@Ruined1 it does indeed work but our securerandom.rb is identical in the sense that we both have a
Ok I was hoping to find something trivial to change here (since I am releasing 188.8.131.52 this morning) but I do not see where random_number is actually defined. There is no references to it in MRI C source and the only ruby definition is commented out. I half wonder if something like openssl gem defines it?