Socket
Socket
Sign inDemoInstall

tweetnacl-util

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tweetnacl-util

String encoding utilitlies extracted from TweetNaCl.js


Version published
Weekly downloads
515K
decreased by-6.88%
Maintainers
1
Install size
6.84 kB
Created
Weekly downloads
 

Readme

Source

tweetnacl-util-js

String encoding utilities extracted from https://github.com/dchest/tweetnacl-js

Encoding/decoding functions are provided for convenience. They are correct, however their performance and wide compatibility with uncommon runtimes is not something that is considered important compared to the simplicity and size of implementation. Please use better third-party libraries if you need to.

Installation

Use a package manager:

Bower:

$ bower install tweetnacl-util

NPM:

$ npm install tweetnacl-util

or download source code.

Usage

To make keep backward compatibility with code that used nacl.util previously included with TweetNaCl.js, just include it as usual:

<script src="nacl.min.js"></script>
<script src="nacl-util.min.js"></script>
<script>
  // nacl.util functions are now available, e.g.:
  // nacl.util.decodeUTF8
</script>

When using CommonJS:

var nacl = require('tweetnacl');
nacl.util = require('tweetnacl-util');

Documentation

nacl.util.decodeUTF8(string)

Decodes string and returns Uint8Array of bytes.

nacl.util.encodeUTF8(array)

Encodes Uint8Array or Array of bytes into string.

nacl.util.decodeBase64(string)

Decodes Base-64 encoded string and returns Uint8Array of bytes.

nacl.util.encodeBase64(array)

Encodes Uint8Array or Array of bytes into string using Base-64 encoding.

Keywords

FAQs

Last updated on 13 Dec 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc