function toPublic() {
if (public_key) {
// cache
// S L O W in the browser
return public_key
}
const Q = secp256k1.G.multiply(d);
return public_key = PublicKey.fromPoint(Q);
}
function toPublic(pubkey_prefix = 'EOS') {
if (public_key) {
// cache
// S L O W in the browser
return public_key
}
const Q = secp256k1.G.multiply(d);
return public_key = PublicKey.fromPoint(Q, pubkey_prefix );
}
eosjs-ecc/src/key_private.js
Line 62 in 2063257
Original edition
Revised
https://www.bcskill.com/index.php/archives/700.html