You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: n.randomBytes is not a function
at Object.o.seedFileSync (E:\cache\crypto.js:7:4534)
at r (E:\cache\crypto.js:7:2210)
at Object.o.generateSync (E:\cache\crypto.js:7:4259)
at Object.o.generate (E:\cache\crypto.js:7:3898)
at Object.e.getBytesSync (E:\cache\crypto.js:1:25919)
at Object. (E:\cache\index.js:18:23)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
The text was updated successfully, but these errors were encountered:
zishang520
changed the title
Use forge.min.js tell
Use forge.min.js tell me n.randomBytes
Sep 3, 2017
zishang520
changed the title
Use forge.min.js tell me n.randomBytes
Use forge.min.js tell me n.randomBytes is not a function
Sep 3, 2017
What version of Node.js is this? Or is this some other environment? The code in lib/prng.js sets _crypto to require('crypto') and later calls randomBytes() on that, so it should work with the standard API.
Thank you for your guidance, I read the source code, know where the problem lies, and my operating environment is WeChat small program, no window.crypto or window.msCrypto
TypeError: n.randomBytes is not a function
at Object.o.seedFileSync (E:\cache\crypto.js:7:4534)
at r (E:\cache\crypto.js:7:2210)
at Object.o.generateSync (E:\cache\crypto.js:7:4259)
at Object.o.generate (E:\cache\crypto.js:7:3898)
at Object.e.getBytesSync (E:\cache\crypto.js:1:25919)
at Object. (E:\cache\index.js:18:23)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
The text was updated successfully, but these errors were encountered: