5

Hey guys I'm working on a vanity address generator using the Stellar JS SDK inside web workers to relief the main thread from heavy computations. However, it is giving me an error 'no PRNG' regarding random number generation only in Safari 10. It is working perfectly in Chrome, Firefox, and Opera.

Any workaround is highly appreciated.

Here is the test code:

// Web worker
importScripts('stellar-sdk.js');

var keypair = StellarSdk.Keypair.random();
var address = keypair.publicKey();
var secret  = keypair.secret();
var account = {publicKey:address, secretKey:secret};
console.log(account);
2

I think the issue is with the limitations of web workers in Safari. I already commented your issue in GitHub.

| improve this answer | |
  • I saw your comment but that doesn't solve my issue, I need a workaround. What's the specific problem with random number generators in workers and what can be done to offer a bypass or add a better library if that's the case? – Kuyawa Jan 18 '18 at 2:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.