Hello, I’m developing an addon and have to create a hmac sha512 hash but jpm says that the crypto module can’t be found (https://nodejs.org/api/crypto.html#crypto_crypto_createhmac_algorithm_key) - can’t I use standard node modules in firefox addon development?
Sorry I’m very new to this.
If not, is there another way to create the hash?
Most node modules won’t work on an extension because they are designed to work server side rather than client side. It could be that you just need to get the non-node version of the library, since I know many add-ons use this crypto lib.
I have the same problem. I’m developing an add-on using jpm and need cryptography functionality. I’m confused by your response because it’s not clear to me how I can load a .js file containing global functions into my node.js namespace. How do I do that?
Do I rewrite all the functions in the crypto lib to become “exports.” functions? So that “function foo(){}” becomes “exports.foo = function(){}”.
I need to do something like this, otherwise I can’t use this lib. I’m a noob at node.js so excuse me if this question is stupid.