@allex/base64
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@allex/base64

Lightweight performance optimized base64 library by Allex

Usage

yarn add @allex/base64 -D
import { encode, decode } from '@allex/base64'

describe('base64 encode/decode', () => {
  test('B64.encode() with string', () => {
    expect(encode('allex')).toBe('YWxsZXg=');
    expect(decode('YWxsZXg=')).toBe('allex');
  });
  test('encode() with urlSafe output', () => {
    expect(encode('allex', true)).toBe('YWxsZXg');
    expect(decode('YWxsZXg')).toBe('allex');
  })
});

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @allex/base64

Weekly Downloads

4

Version

1.0.2

License

MIT

Unpacked Size

9.38 kB

Total Files

6

Last publish

Collaborators

  • allex