Skip to content

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

@cppfuns

Description

@cppfuns

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions