Base85 encoding and decoding using ArrayBuffers with no external dependencies and can be run outside NodeJS.
Your JavaScript engine should support ArrayBuffers. Most modern browsers support this, as well as NativeScript, Node.JS and more.
npm install base85-arraybuffer --save
Use
Usage code snippets here
Encode an ArrayBuffer or ArrayBufferView (like Uint8Array or other Typed Arrays)
encode(data: ArrayBuffer | ArrayBufferView, options?: Base85Options): string;
Encodes a UTF-8 string
encodeString(data: string, options?: Base85Options): string;
Decodes a Base85-encoded string to an ArrayBuffer.
decode(data: string, options?: Base85Options): ArrayBuffer;
Decodes a Base85-encoded string to a UTF-8 string
decodeString(data: string, options?: Base85Options): string;
Property | Default | Description |
---|---|---|
variant | Defaults to ascii85 |
The encoding variant to use. Possible values are ascii85 and z85 |
zeroesAsZ | false | Should a group of all zeroes be encoded as a single z (ascii85 only) |
spacesAsY | false | Should a group of all spaces be encoded as a single y (ascii85 only) |
base85-arraybuffer is licensed under the MIT license.