c0mm4nd / dart-secp256k1

Fucking dart!!! Force me to write all deps!!!
https://pub.dev/packages/secp256k1
MIT License
12 stars 1 forks source link

Sign : Equivalence js method #3

Closed redDwarf03 closed 3 years ago

redDwarf03 commented 3 years ago

Hello

I try to find an equivalence in dart of this js method :

 sign(hash, key) {

    const { signature, recid } = secp256k1.ecdsaSign(
      new Uint8Array(hash),
      hexToUint8Array(key)
    );

    this.signature = Buffer.from([...signature, recid]);

    return this;
  }

this part is complicated to code for me: "Buffer.from([...signature, recid])" in dart and I don't know how to retrieve recid with your code.

Could you help me please ?

redDwarf03 commented 3 years ago

i find the solution in this project https://github.com/shareven/wallet_hd