Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@alttiri/base85

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alttiri/base85 - npm Package Compare versions

Comparing version 1.7.3 to 1.7.4

2

package.json
{
"name": "@alttiri/base85",
"version": "1.7.3",
"version": "1.7.4",
"description": "Pretty fast base85 JavaScript library",

@@ -5,0 +5,0 @@ "author": "alttiri",

@@ -14,7 +14,7 @@ # base85

[`encode`](https://github.com/AlttiRi/base85/blob/42343e624f27ec68aa936a274c297ccd6c15c8cb/index.js#L42) encodes the input `Uint8Array` into base85 `string`.
[`encode`](https://github.com/AlttiRi/base85/blob/473721c67aa01a3bd8920fe63ea1b8eca3af30fa/base85.ts#L48) encodes the input `Uint8Array` into base85 `string`.
#### `function decode(base85: string, charset?: "ascii85" | "z85" | string): Uint8Array`
[`decode`](https://github.com/AlttiRi/base85/blob/42343e624f27ec68aa936a274c297ccd6c15c8cb/index.js#L84) decodes the input base85 `string` into `Uint8Array`.
[`decode`](https://github.com/AlttiRi/base85/blob/473721c67aa01a3bd8920fe63ea1b8eca3af30fa/base85.ts#L90) decodes the input base85 `string` into `Uint8Array`.

@@ -30,2 +30,4 @@ `charset` is "z85" by default.

```js
import {encodeBase85} from "@alttiri/base85";
// png image, 169 bytes

@@ -43,3 +45,3 @@ const imageBytes = new Uint8Array([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,2,0,0,0,252,24,237,163,0,0,0,1,115,82,71,66,0,174,206,28,233,0,0,0,4,103,65,77,65,0,0,177,143,11,252,97,5,0,0,0,9,112,72,89,115,0,0,14,195,0,0,14,195,1,199,111,168,100,0,0,0,62,73,68,65,84,72,75,237,210,49,10,0,48,8,197,80,239,127,105,187,252,161,208,150,32,93,243,86,149,44,86,191,213,33,131,9,3,200,0,50,128,12,160,92,74,63,242,77,55,217,216,100,48,97,0,25,64,6,144,1,208,189,0,183,189,228,126,66,93,37,1,0,0,0,0,73,69,78,68,174,66,96,130]);

If you need to encode a text _(are you really need it?)_ [use `TextEncoder`/`TextDecoder`](https://github.com/AlttiRi/base85/blob/1b04256730cbbedcb6dbbd7e14fe4a6ac7575ce2/tests/util.js#L17-L29).
If you need to encode a text _(are you really need it?)_ [use `TextEncoder`/`TextDecoder`](https://github.com/AlttiRi/base85/blob/473721c67aa01a3bd8920fe63ea1b8eca3af30fa/tests/util.js#L17-L29).

@@ -62,3 +64,3 @@ ```js

~You can test the lib online in the browser's console: https://alttiri.github.io/base85/online~ _(todo: fix it)_
You can test the lib online in the browser's console: https://alttiri.github.io/base85/online

@@ -65,0 +67,0 @@ All required things are already in the global scope. (`encode`, `decode`; util functions: `utf8StringToArrayBuffer` and others; `Tester` class too.)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc