java - How to generate a key with seed? -


i need generate key algorithm seed (byte array). code doesn't work, because it's give 2 different results on different platforms:

byte seed [] = {50,30,...}; byte result [] = new byte [20]; securerandom rand = new securerandom(); rand.setseed(seed); rand.nextbytes(result); 

i need same results on different platforms.

use sha1prng algorithm istead of nativeprng.

securerandom rand = securerandom.getinstance("sha1prng"); rand.setseed(seed); rand.nextbytes(result); 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -