@mainframe/utils-base64
v0.1.1
Published
Base64 encoding utilities
Downloads
9
Keywords
Readme
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
value: any
Returns base64
encodeBase64()
Arguments
input: Buffer
Returns base64
decodeBase64()
Arguments
input: base64
Returns Buffer
License
MIT