Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 1.03 KB

README.md

File metadata and controls

26 lines (20 loc) · 1.03 KB

This is an implementation of a streaming Base64 encoder and decoder for JavaScript, with the actual encoding and decoding logic being handled by Uint8Array.fromBase64() and Uint8Array.prototype.toBase64() from the proposal-arraybuffer-base64.

The streaming decoder supports streaming decoding and encoding. It correctly handles padding and whitespace. There is both a WHATWG TransformStream, and a sync-Iterator based API available.

You can see the implementations for the various APIs in:

To play with it:

$ deno repl -A --eval="import { Base64DecoderStream, Base64EncoderStream, decodeBase64, encodeBase64 } from './index.ts'"
Deno 1.37.0
exit using ctrl+d, ctrl+c, or close()
>

To run tests, run deno test.