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

b36

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

b36

Simple utility for converting between base36 strings and buffers

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
46K
increased by25.53%
Maintainers
1
Weekly downloads
 
Created
Source

b36

Simple utility for converting between base36 strings and buffers

Base36 is slightly more compact than hex encoding, but is still safe to use for things like hostnames.

Encoding

const { encode } = require('b36')
let key = require('crypto').randomBytes(32)

console.log(encode(key))
// Sample output:
//   2jn5z3wzqnt6adgw7dwo98krsz6pku9cckb0cizs34pv025lpf

Decoding

const { decode } = require('b36')
let str = '2jn5z3wzqnt6adgw7dwo98krsz6pku9cckb0cizs34pv025lpf'
console.log(decode(str))
// Sample output:
// <Buffer 66 23 0d 7c 73 64 81 7f 1b 64 73 c8 24 f9 e4 2e 6b f8 bd 5b d6 3f 55 8e 62 8d db 9d 60 fe 6f 23>

FAQs

Package last updated on 09 Oct 2017

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