Closed jaromil closed 6 years ago
I propose the following patches (and pushed them to jaromil:emscripten-1).
#include
's to top of file.static int
._malloc()
and #include <stdlib.h>
. Also, I added some error handling, because crypto.randomBytes
mentions:
An error will be thrown if there is a problem generating the bytes.
Would you agree to the proposed changes? Did I miss something?
Much better now. I realise I won't be able on the short term to make an emscripten compatible test to work in the CI, but if you like to merge it anyway go ahead.
Thanks a lot for your contribution!
Adds simple support to use the crypto api provided by nodejs when cross-building using emscripten.