asmcrypto / asmcrypto.js

JavaScript Cryptographic Library with performance in mind.
MIT License
659 stars 182 forks source link

Bug require('crypto') #167

Open jrabello opened 5 years ago

jrabello commented 5 years ago

Hi, at file src/other/get-random-values.ts there is the following conditional:

if (typeof process !== 'undefined') {
  const nodeCrypto = require('crypto');

Running angular ng cli this conditional evaluates to true, but we have the following error:

ERROR in /home/jrabelo/codes/cm-codebase/core/node_modules/asmcrypto.js/asmcrypto.all.es8.js
Module not found: Error: Can't resolve 'crypto' in '/home/jrabelo/codes/cm-codebase/core/node_modules/asmcrypto.js'

I think We need to be able to check if crypto exists in current namespace