in actual implementations of multiplatform code I intended to replace with browser compatible code. Somehow if I run my tests in the browser, the node functions all work and tests succeed in all browsers. (Firefox/Safari/Chrome) How can this be explained? Can I expect these functions to run in a proper application? Or am I overlooking something?
b
bashor
03/30/2020, 12:35 PM
Likely them were polyfilled, I think you can check it by debugging your code inside a browser.
Thanks for the reply! I debugged the code and it seems two npm packages where loaded that contained the relevant code: https://www.npmjs.com/package/randombyteshttps://www.npmjs.com/package/buffer
randombytes indeed uses getRandomValues()
Can I trust these npm packages to be there in future releases or would it be wise to manually add them?
Jurriaan Mous
03/30/2020, 8:57 PM
Should random crypto bytes and base64 functionality maybe instead be exposed in the js or multiplatform standard library?
b
bashor
03/30/2020, 9:10 PM
Can I trust these npm packages to be there in future releases or would it be wise to manually add them?
adding manually/explicitly could be more robust
Should random crypto bytes and base64 functionality maybe instead be exposed in the js or multiplatform standard library?