This commit is contained in:
Paul Miller 2023-08-04 22:47:59 +00:00
parent b0af0a8977
commit 2bd437df4e
No known key found for this signature in database
GPG Key ID: 697079DA6878B89B

@ -43,12 +43,10 @@ If you don't like NPM, a standalone [noble-curves.js](https://github.com/paulmil
The package consists of two parts:
implementations (using [noble-hashes](https://github.com/paulmillr/noble-hashes)), and zero-dep abstract api.
Generic example for all curves, secp256k1:
Generic example for all curves, shown with secp256k1:
```ts
// import * from '@noble/curves'; // Error
// Use sub-imports for tree-shaking, to ensure small size of your apps
// Each curve has similar methods
// import * from '@noble/curves'; // Error: use sub-imports, to ensure small app size
import { secp256k1 } from '@noble/curves/secp256k1'; // ESM and Common.js
// import { secp256k1 } from 'npm:@noble/curves@1.2.0/secp256k1'; // Deno
const priv = secp256k1.utils.randomPrivateKey();