Socket
Book a DemoInstallSign in
Socket

@ctrl/ts-base32

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons

@ctrl/ts-base32

unpublished
Source
npmnpm
Version
4.0.2
Maintainers
1
Created
Source

ts-base32 npm coverage bundlesize

Base32 encode and decode in typescript exported as both commonjs and tree shakeable modules. Support for RFC4648, RFC4648_HEX, and CROCKFORD base32 encoding. Mostly directly taken from LinusU's packages.

Demo: https://ts-base32.vercel.app

Install

npm install @ctrl/ts-base32

Use

import { base32Encode, base32Decode } from '@ctrl/ts-base32';
import { stringToUint8Array, uint8ArrayToString } from 'uint8array-extras';

console.log(base32Encode(stringToUint8Array('a')));
// 'ME======'

console.log(base32Encode(stringToUint8Array('a'), { padding: false }));
// 'ME'

console.log(base32Decode('ME======'));
// Uint8Array

console.log(uint8ArrayToString(base32Decode('ME======'))
// 'a'

See Also

base32-encode - https://github.com/LinusU/base32-encode
base32-decode - https://github.com/LinusU/base32-decode
uint8array-extras - https://github.com/sindresorhus/uint8array-extras

FAQs

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