Socket
Socket
Sign inDemoInstall

sodium-universal

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sodium-universal

Universal wrapper for sodium-javascript and sodium-native working in Node.js and the Browser


Version published
Weekly downloads
8.2K
decreased by-5.48%
Maintainers
2
Weekly downloads
 
Created
Source

sodium-universal

Universal wrapper for sodium-javascript and sodium-native working in Node.js and the Browser

npm install sodium-universal

Usage

var sodium = require('sodium-universal')

var rnd = Buffer.allocUnsafe(12) // Cryptographically random data
sodium.randombytes_buf(rnd)

console.log(rnd.toString('hex'))

Works seamlessly with Node.js:

$ node example.js
c7dbd46a6cc84ff2e0d1285c

And the browser:

browserify example.js > bundle.js

Introduction

libsodium is a collection of cryptographic primitives, providing a low-level foundation to build higher-level cryptographic applications and protocols. It is often put in contrast to RSA based cryptography and OpenSSL, even though they all share overlapping algorithms and target slightly different audiences. Sodium is a collection of modern collection of primitives, fulfilling the same cryptographic tasks, but based on simpler and more efficient algorithms.

This library provides seamless bindings to sodium-native, which is the original C implementation of libsodium exposed as a Node native module. For the browser we expose sodium-javascript, using the package.json browser field, which is supported by most bundlers.

API

Please refer to sodium-native and sodium-javascript. Note that the two modules do not yet have feature parity, where sodium-native is the more featureful of the two.

License

MIT

Keywords

FAQs

Package last updated on 08 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc