Libsodium for Node.js
npm install @devtomio/sodium



Packages










- Fully ready for TypeScript!
- Includes ESM ready entrypoint
- Easy to use
- Has the same API as libsodium
- Faster than similar libraries (see benchmarks)
- Powered by Rust
---
_For complete usages, please dive into our [documentation]_
Generating a keypair
``typescript
import * as sodium from '@devtomio/sodium';
const { public_key, secret_key } = sodium.crypto_box_keypair();
`
`sh
$ yarn bench
Running "keypair generation" suite...
Progress: 100%
libsodium-wrappers:
5 211 ops/s, ±4.63% | 73.06% slower
tweetnacl:
1 100 ops/s, ±4.69% | slowest, 94.31% slower
chloride:
13 909 ops/s, ±10.91% | 28.1% slower
@devtomio/sodium:
19 344 ops/s, ±3.12% | fastest
Finished 4 cases!
Fastest: @devtomio/sodium
Slowest: tweetnacl
``
Thanks goes to these wonderful people (emoji key):
Tomio 💻 📖 💡 🤔 🚇 🚧 📦 | WhiteSource Renovate 🚧 | renovate[bot] 🚧 |
This project follows the all-contributors specification. Contributions of any kind welcome!
This software is released under the MIT License, see LICENSE.

[documentation]: https://devtomio.github.io/sodium