errors-base
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

errors-base

A tool to help with encoding and decoding different radius' of various bases.

By default Base uses Base62 alphabet.

Table of Contents

Installation

yarn add errors-base

Usage

import Base from "errors-base";
 
// Basic
Base.encode(999); // g7
Base.decode("g7"); // 999
 
// With decimals
Base.encode(999.999); // g7.g7
Base.decode("g7.g7"); // 999
 
// Negative numbers
Base.encode(-999); // -g7
Base.decode("-g7"); // -999
 
// Negative numbers with decimals
Base.encode(-999.999); // -g7.g7
Base.decode("-g7.g7"); // -999.999
 
// Custom alphabet
const base: Base = new Base([ "0", "1", "2", "3", "4", "5", "6", "7" ]);
 
// ...

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i errors-base

Weekly Downloads

0

Version

1.0.1

License

UNLICENSED

Unpacked Size

7.42 kB

Total Files

10

Last publish

Collaborators

  • ihack2712