invisal / god_crypto

Pure Javascript/Typescript Crypto Implementation for Deno. AES, RSA, HMAC, and TOTP
MIT License
93 stars 16 forks source link

Incompatibility with web worker? #30

Open finlaydotb opened 3 years ago

finlaydotb commented 3 years ago

I am using another deno library which has god_crypto as a dependency and introducing that library leads to compile error which comes from god_crypto

I created the issue here for that https://github.com/JamesBroadberry/deno-bcrypt/issues/15

But since the error seems to stem from god_crypto I was wondering whether you might have any insight into the issue and better still suggestions on how to fix it.

Thanks

timonson commented 3 years ago

Hi @invisal , window is not available in a Web Worker. I would suggest changing window to globalThis. Thank you! https://github.com/timonson/djwt/issues/48

finlaydotb commented 3 years ago

But the baffling thing is that there is no where in my application where I am using window in the code. So not sure where to change window to globalThis 😬