You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The libsodium dependency accounts for > 60% of the resulting bundle. I think most things that libsodium is used for can be accomplished with @noble/curves and @noble/hashes to a significantly lower price. I believe the WebCrypto API can be used generating random bytes with crypto.getRandomValues().
The text was updated successfully, but these errors were encountered:
From dev call: there may be a WebAssembly or other libsodium library. The current library we use was selected many years ago. There may be a different usable one we could use now. Or potentially fork the libsodium library and have only the features that we need.
Charles node_modules/libsodium-sumo/dist/modules-sumo/libsodium-sumo.js is the WASM version, that's why it's so big.
Sam: we may be getting the tradeoff of speed vs size here. There is a full JavaScript impl that is pretty small.
See result of
esbuild --analyze
:The libsodium dependency accounts for > 60% of the resulting bundle. I think most things that libsodium is used for can be accomplished with @noble/curves and @noble/hashes to a significantly lower price. I believe the WebCrypto API can be used generating random bytes with
crypto.getRandomValues()
.The text was updated successfully, but these errors were encountered: