+ 3

Random Number

Is there any way to generate random numbers in any programming language without using functions like math.random or related function. I mean purely a block of statement to generate randoms

6th Mar 2017, 1:06 AM
Raghav Gupta
Raghav Gupta - avatar
1 Antwort
+ 3
String charsCaps = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; String chars = "abcdefghijklmnopqrstuvwxyz"; String nums = "0123456789"; String symbols = "!@#$%^&*_=+-/€.?<>)"; String passSymbols = charsCaps + chars + nums + symbols; Random rnd = new Random(); char[] password = new char[len]; int index = 0; for (int i = 0; i < len; i++) { password[i] = passSymbols.charAt(rnd.nextInt(passSymbols.length())); }
6th Mar 2017, 1:25 AM
Faruque Hossain
Faruque Hossain  - avatar