Open clangenb opened 2 months ago
Hi. What is your deployment/runtime that does not support crypto.createHash
?
Hi there, thanks for the quick response! I am not a pro when it comes to the JS world, so I am not sure if this is the correct piece of information. Essentially, it is this tiny nuxt project that I am working on: https://github.com/integritee-network/incognitee-campaign-page/pull/10.
Frramework: Nuxt 3.11.2 with Nitro 2.9.6
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโPreview Modeโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ You are running Nuxt production build in preview mode. โ
โ For production deployments, please directly use node ./server/index.mjs command. โ
โ โ
โ Node.js: v21.7.3 โ
โ Nitro Preset: node-server โ
โ Working directory: .output โ
โ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Unfortunately, I just realized that I will probably need more than only this function as an RSA library needs this polyfill, so I guess unenv is probably not the right solution as most of the crypto polyfills are not implemented...
Thanks again for the swift answer!
I mean the crypto is running in the browser, and I was checking the code in node/modules/unenv/runtime/node/crypto/node.mjs
and I see those lines, which is why I thought it is unimplemented.
export const createDecipheriv = notImplemented("crypto.createDecipheriv");
export const createDiffieHellman = notImplemented("crypto.createDiffieHellman");
export const createDiffieHellmanGroup = notImplemented("crypto.createDiffieHellmanGroup");
export const createECDH = notImplemented("crypto.createECDH");
export const createHash = notImplemented("crypto.createHash");
export const createHmac = notImplemented("crypto.createHmac");
export const createPrivateKey = notImplemented("crypto.createPrivateKey");
export const createPublicKey = notImplemented("crypto.createPublicKey");
export const createSecretKey = notImplemented("crypto.createSecretKey");
This is the log that I saw in the browser that made me think that I am on the right track:
Am I doing something wrong? Any pointer would be appreciated.
Oh right. Yes, they are node.js specific APIs we didn't implement in the browser let me to reopen to investigate how hard it would be to support them.
Describe the feature
This is currently a showstopper for our project
Additional information