Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
100K
decreased by-4.78%
Maintainers
1
Weekly downloads
 
Created
Source

Base32 Encode

Base32 encoder with support for multiple variants.

Installation

npm install --save base32-encode

Usage

import base32Encode from '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, required)
  • variant ('RFC3548' | 'RFC4648' | 'RFC4648-HEX' | 'Crockford', required)
  • options (object, optional)
    • padding (boolean, optional) - If set, forcefully enable or disable padding. The default behavior is to follow the default of the selected variant.
  • returns string

Encode the data in data into a Base32 encoded string.

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

See also

Keywords

FAQs

Package last updated on 24 Jul 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