@allex/base64
v1.0.2
Published
Lightweight performance optimized base64 library by Allex
Downloads
10
Readme
@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');
})
});