I'm currently working on a companion android app to an existing VB .NET application. Both of them have login pages that encrypt the user's password. Part of this encryption involves random number generation.
I'd like the app to be able to produce the same random number as the VB .NET application so that the password is encrypted the same way. I don't know if that's possible, even if I use the same seeds. Is there any way I can generate the same 'random' number in Java, or are the algorithms used to produce the numbers just too different?
VB .NET (T just being a long)
Call Rnd(-1)
Randomize(T)
Dim result As Double = Rnd()
' Produces 0.609 ...
Java (Not sure if I can even use T anywhere here)
Random rand = new Random(-1);
double result = rand.nextDouble();
// Produces 0.2689 ...
Aucun commentaire:
Enregistrer un commentaire