@quentinadam/base64
v0.1.4
Published
A simple library to encode and decode base64 strings
Downloads
129
Readme
@quentinadam/base64
A simple library to encode and decode base64 strings.
Optionnaly supports specifying the alphabet to use.
Usage
import * as base64 from '@quentinadam/base64';
base64.encode(new Uint8Array([102, 111, 111, 98])); // returns 'Zm9vYg=='
base64.decode('Zm9vYg=='); // returns Uint8Array([102, 111, 111, 98])
base64.encode(new Uint8Array([102, 111, 111, 98]), { padding: false }); // returns 'Zm9vYg'