Home Manual Reference Source

:fax:

@codec-bytes/base64

Base64 encoder/decoder for JavaScript. See docs. Parent is @codec-bytes/about.

import * as ascii from '@codec-bytes/ascii';
import * as base64 from '@codec-bytes/base64';
let bytes = ascii.encode('any carnal pleasure');
base64.decode(bytes); // 'YW55IGNhcm5hbCBwbGVhc3VyZQ=='
base64.decode(bytes, {variant: 'RFC7515'}); // 'YW55IGNhcm5hbCBwbGVhc3VyZQ'
base64.decode(bytes, {variant: 'Y64'}); // 'YW55IGNhcm5hbCBwbGVhc3VyZQ--'
base64.decode(bytes, {alphabet: 'BCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/A', padding: '.'}); // 'ZX66JHOidn6icDCxcHWid4WzaR..'

License Version Tests Dependencies GitHub issues Downloads

Code issues Code maintainability Code coverage (cov) Code technical debt Documentation Package size