1.0.2 • Published 4 years ago

@allex/base64 v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@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