We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I needed to seed the PRNG with a specific value. After some poking around I found that it can be done like so:
function hex2Array(hex) { var arr = new Array(); for (var i = 0; i < hex.length; i += 2) arr[i/2] = parseInt(hex.substr(i, 2), 16); return arr; }
var seedByteArray = hex2Array(seedHexStr);
//////////////// rng_state = prng_newstate(); rng_state.init(seedByteArray); ///////////////
It might be nice to add these last two lines into a "seed" function of the SecureRandom class in the future
The text was updated successfully, but these errors were encountered:
@kjur Any chance that this will be implemented?
Sorry, something went wrong.
No branches or pull requests
I needed to seed the PRNG with a specific value. After some poking around I found that it can be done like so:
function hex2Array(hex)
{
var arr = new Array();
for (var i = 0; i < hex.length; i += 2)
arr[i/2] = parseInt(hex.substr(i, 2), 16);
return arr;
}
var seedByteArray = hex2Array(seedHexStr);
////////////////
rng_state = prng_newstate();
rng_state.init(seedByteArray);
///////////////
It might be nice to add these last two lines into a "seed" function of the SecureRandom class in the future
The text was updated successfully, but these errors were encountered: