Skip to content
This repository has been archived by the owner on Jul 30, 2023. It is now read-only.

jzeuzs/sodium

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@devtomio/sodium

Libsodium for Node.js

GitHub Continuous Delivery Continuous Integration npm

Packages

npm npm npm npm npm npm npm npm npm npm

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:
    5 109 ops/s, ±3.12%    | 85.44% slower

  tweetnacl:
    1 108 ops/s, ±1.11%    | slowest, 96.84% slower

  chloride:
    21 946 ops/s, ±7.45%   | 37.46% slower

  sodium:
    23 691 ops/s, ±1.00%   | 32.49% slower

  @devtomio/sodium:
    35 092 ops/s, ±2.84%   | fastest

Finished 5 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.

FOSSA Status