browserify / browserify/crypto-browserify

function createPrivateKey missing

Open
#240 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
681
Forks
209
PR merge metrics
No merged PRs in 30d

Description

I am working on a Lynx project and using their [polyfills package](https://github.com/rspack-contrib/rsbuild-plugin-node-polyfill) which uses crypto-browserify for polyfilling the crypto package.

I am also using @permaweb/aoconnect package which relies on the createPrivateKey function from node:crypto, which seems to be missing from crypto-browserify, and results in the following error:

```
File: /Users/weeblet/Developer/ARWEAVE/FWD/subspace/mobileapp/node_modules/@permaweb/aoconnect/dist/index.js|react:main-thread:1:1
× ESModulesLinkingError: export 'createPrivateKey' (imported as 'createPrivateKey') was not found in 'node:crypto' (possible exports: Cipher, Cipheriv, Decipher, Decipheriv, DiffieHellman, DiffieHellmanGroup, Hash, Hmac, Sign, Verify, constants, createCipher, createCipheriv, createCredentials, createDecipher, createDecipheriv, createDiffieHellman, createDiffieHellmanGroup, createECDH, createHash, createHmac, createSign, createVerify, getCiphers, getDiffieHellman, getHashes, listCiphers, pbkdf2, pbkdf2Sync, privateDecrypt, privateEncrypt, prng, pseudoRandomBytes, publicDecrypt, publicEncrypt, randomBytes, randomFill, randomFillSync, rng)
╭─[1876:23]
1874 │ function createSigner(wallet) {
1875 │ const publicKey = Buffer.from(wallet.n, "base64url");
1876 │ const privateKey = createPrivateKey({
· ────────────────
1877 │ key: wallet,
1878 │ format: "jwk"
╰────

@ ./src/App.tsx
@ ./src/index.tsx
```

are there any plans for adding the missing function(s) to crypto-browserify?

Thanks

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.