Random numbers generation in java and VB
I have to duplicate a program written in VB to java.The problem Iam facing is that random numbers are used for encryting in VB.The random numbers that Iam generating in my java code are different from those being generated by my VB program.Are the algorithms for random number different in VB and java?Is there some other way to generate random numbers in java other then using Random class
Thanks in advance
amit
What did you expect? You are asking for *random* numbers, not numbers given by this or that particular pseudo-random number generator. If you want the same "random" numbers you'll need to make a function/method of your own and implement it in both VB and Java.
> Is there some other way to generate random numbers
> in java other then using Random class
Yes, Math.random()
Depends on the implementation. A RNG with the same seed will always generate the same sequence, regardless of the language, just like 2+2 = 4 in every language. You just need to get an implementation of the same RNG in both languages.
It's probably easier to port the Random class to VB since we have the source for it...