Socket
Socket
Sign inDemoInstall

sodium-browserify

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sodium-browserify

browser polyfil for sodium


Version published
Weekly downloads
179
decreased by-1.65%
Maintainers
1
Weekly downloads
 
Created
Source

sodium-browserify

A polyfil between the apis of node-sodium and libsodium-wrappers, heir to crypto-browserify

Mainly, this wraps libsodium-wrappers to make it work with buffers, and pass the same tests as it does in node, and in the browser.

UPDATE: WebAssembly!

This now uses webassembly, for a massive speed improvement. one of the weird quirks of webassembly is that it gets loaded async, which means you'll only get this speed improvement after waiting a little while, say 50ms, but in most applications something else will need to load, such as reading database state or waiting for connections, so this will happen on it's own.

If you try to use this before the wasm has loaded, it will fallback to tweetnacl.

An event is available to ensure wasm is loaded before proceeding:

var s = require('sodium-browserify')

s.events.on('sodium-browserify:wasm loaded', function() {
  console.log("wasm was loaded!")
})

Tests are generated from sodium, with values stored in JSON so that they can be run in the browser.

License

MIT

FAQs

Package last updated on 16 Jul 2019

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