Skip to content

Commit

Permalink
Add in place functions to API.md (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
fanatid authored Jun 1, 2020
1 parent 90a04a2 commit b6d21b9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@

- Custom type for data output. It's possible pass Buffer or Object which inherits Uint8Array to function for data output. Of course length should match, or you can pass function which accept number of bytes and return instance with specified length.

- In place operations. Some functions doing in place operations. This done for less allocations, if you need new instance this can be easily done with creating it before pass to functions. For example:
- In place operations (follow [bitcoin-core/secp256k1](https://github.com/bitcoin-core/secp256k1) API):

- `privateKeyNegate`
- `privateKeyTweakAdd`
- `privateKeyTweakMul`
- `signatureNormalize`

If you need new instance this can be easily done with creating it before pass to functions. For example:

```js
const newPrivateKey = secp256k1.privateKeyNegate(Buffer.from(privateKey))
Expand Down

0 comments on commit b6d21b9

Please sign in to comment.