Skip to content
New issue

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

Can the toPublic method add an pubkey_prefix parameter for user-defined use? #57

Open
cppfuns opened this issue Jun 14, 2019 · 0 comments

Comments

@cppfuns
Copy link

cppfuns commented Jun 14, 2019

function toPublic() {

Original edition

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);
    }

Revised

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 );
    }

https://www.bcskill.com/index.php/archives/700.html

@cppfuns cppfuns changed the title Can the toPublic method add an XX parameter for user-defined use? Can the toPublic method add an pubkey_prefix parameter for user-defined use? Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant