Nonprofit Pizza Maker

    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" ]);
     
    // ...

    Keywords

    none

    Install

    npm i errors-base

    DownloadsWeekly Downloads

    2

    Version

    1.0.1

    License

    UNLICENSED

    Unpacked Size

    7.42 kB

    Total Files

    10

    Last publish

    Collaborators

    • ihack2712