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

    1.0.0 • Public • Published

    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

    Keywords

    none

    Install

    npm i simple-base

    DownloadsWeekly Downloads

    44

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    5.32 kB

    Total Files

    10

    Last publish

    Collaborators

    • gplane