Socket
Socket
Sign inDemoInstall

simple-base

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-base

A simple base36/base58 converter.


Version published
Weekly downloads
15K
decreased by-5.96%
Maintainers
1
Weekly downloads
 
Created
Source

Simple Base

Azure Pipelines

Simple Base is a simple library to encode or decode with base36/base58.

It is available both in Node and browsers.

Installation

yarn add simple-base

or

npm i simple-base

You also can link it by script tag in HTML. SimpleBase will be a global variable.

Usage

Use CommonJS:

const SimpleBase = require('simple-base')

Use ES2015 Modules:

import * as SimpleBase from 'simple-base'

Base36

Encoding:

const encoded = SimpleBase.encode('hello', 36)
// or
const encoded = SimpleBase.base36.encode('hello')

Decoding:

const decoded = SimpleBase.decode('5pzcszu7', 36)
// or
const decoded = SimpleBase.base36.decode('5pzcszu7')

Base58

Encoding:

const encoded = SimpleBase.encode('hello', 58)
// or
const encoded = SimpleBase.base36.encode('hello')

Decoding:

const decoded = SimpleBase.decode('Cn8eVZg', 58)
// or
const decoded = SimpleBase.base36.decode('Cn8eVZg')

License

MIT License © Pig Fang

FAQs

Package last updated on 04 Mar 2019

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