Open sgehrman opened 6 years ago
Thanks for the suggestion. Good point to save those variables in a const, however i don't expect that much of a performance win. .length
and .toUpperCase()
are both very cheap compared to the StellarSdk.Keypair.random();
function.
I'll update it and push when i'm home.
Hey, I sent in a pull request, see if it's much faster. CPUs will max out for sure with these changes.
Wouldn't it be a bit faster if you made some variables outside the loop? Let me know if you try it and see if it's faster.
let length = name.length let upperCaseName = name.toUpperCase()
while (keypair.publicKey().slice(-length ) !== upperCaseName ) {
}