Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
SecureRandom.random_number doesn't accept a range #4607
The problem is here:
At some point, the code to handle ranges was removed.
jruby 18.104.22.168 (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 22.214.171.124 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?