When bundling for the browser it looks like the underlying crypto library (sodium-javascript) works on Uint8Array objects and not Buffers. This causes an error when they get to those Buffer.concat calls:
Error [TypeError]: "list" argument must be an Array of Buffers
I've replaced them with Buffer.from which should convert the Uint8Array values to instances of Buffer. This should should allow the library to be used in a browsers environment with more configurations and resolve some of the problems mentioned in #5.
PS: We've created a testing framework to easily run mocha unit-tests in different browsers using playwright. Let me know if you are interested, I can submit a PR.
When bundling for the browser it looks like the underlying crypto library (
sodium-javascript
) works onUint8Array
objects and not Buffers. This causes an error when they get to thoseBuffer.concat
calls:I've replaced them with
Buffer.from
which should convert theUint8Array
values to instances ofBuffer
. This should should allow the library to be used in a browsers environment with more configurations and resolve some of the problems mentioned in #5.PS: We've created a testing framework to easily run mocha unit-tests in different browsers using playwright. Let me know if you are interested, I can submit a PR.