Features
- 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
Usage
For complete usages, please dive into our documentation
Basic usage
Generating a keypair
import * as sodium from '@devtomio/sodium';
const { public_key, secret_key } = sodium.crypto_box_keypair();
Benchmarks
$ yarn bench
Running "keypair generation" suite...
Progress: 100%
libsodium-wrappers:
3 532 ops/s, ±7.21% | 87.99% slower
tweetnacl:
859 ops/s, ±3.72% | slowest, 97.08% slower
@devtomio/sodium:
29 402 ops/s, ±5.38% | fastest
Finished 3 cases!
Fastest: @devtomio/sodium
Slowest: tweetnacl
Contributors ✨
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!
License
This software is released under the MIT License, see LICENSE.