@mainframe/utils-base64

    0.1.1 • Public • Published

    utils-base64

    Utilities for base64-encoded strings.

    Installation

    yarn add @mainframe/utils-base64

    Usage

    import { encodeBase64, decodeBase64 } from 'utils-base64'
     
    const buffer = Buffer.from('test')
    const encoded = encodeBase64(buffer) // base64 (string)
    const decoded = decodeBase64(encoded) // Buffer

    Types

    base64

    Opaque type representing a base64-encoded string.

    API

    base64Type()

    Simple identity function casting the provided value as base64 to properly type-check.

    Arguments

    1. value: any

    Returns base64

    encodeBase64()

    Arguments

    1. input: Buffer

    Returns base64

    decodeBase64()

    Arguments

    1. input: base64

    Returns Buffer

    License

    MIT

    Keywords

    none

    Install

    npm i @mainframe/utils-base64

    DownloadsWeekly Downloads

    6

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    2.97 kB

    Total Files

    7

    Last publish

    Collaborators

    • sarahwiley
    • mosic
    • aclarke
    • howleysv
    • diogoperillo
    • paul_lecam