Socket
Socket
Sign inDemoInstall

base32-encode

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base32-encode

Base32 encoder with support for multiple variants.


Version published
Weekly downloads
105K
decreased by-8.44%
Maintainers
1
Weekly downloads
 
Created
Source

Base32 Encode

Base32 encoder with support for multiple variants.

Installation

npm install --save base32-encode

Usage

const base32Encode = require('base32-encode')
const data = new Uint8Array([0x74, 0x65, 0x73, 0x74])

console.log(base32Encode(data, 'Crockford'))
//=> EHJQ6X0

console.log(base32Encode(data, 'RFC4648'))
//=> ORSXG5A=

console.log(base32Encode(data, 'RFC4648', { padding: false }))
//=> ORSXG5A

console.log(base32Encode(data, 'RFC4648-HEX'))
//=> EHIN6T0=

API

base32Encode(data, variant, options)

  • data <ArrayBuffer | Int8Array | Uint8Array | Uint8ClampedArray>
  • variant <String>
  • options <Object>
    • padding <Boolean>

Encode the data in data. variant should be one of the supported variants listed below.

  • 'RFC3548' - Alias for 'RFC4648'
  • 'RFC4648' - Base32 from RFC4648
  • 'RFC4648-HEX' - base32hex from RFC4648
  • 'Crockford' - Crockford's Base32

Options may have a padding property which provides a way to forcefully enable or disable padding. The default behavior is to follow the default of the selected variant.

See also

Keywords

FAQs

Package last updated on 30 Mar 2021

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