Socket
Socket
Sign inDemoInstall

z85-codec

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    z85-codec

Z85 - ZeroMQ's ascii85 encoding format


Version published
Weekly downloads
447
increased by32.25%
Maintainers
1
Install size
39.3 kB
Created
Weekly downloads
 

Readme

Source

z85-codec

NPM Coverage Status

Z85 - ZeroMQ's ascii85 encoding format

Why should i use this package instead of z85?

This package and z85 uses the same reference implementation provided by ZeroMQ. The difference is that this library provides Typescript declarations and uses typed arrays to be compatible in the browser.

API

encode(data: Uint8Array | string): string | null

Encode data with the Z85 codec

Parameters
  • data: Uint8Array | string - data to encode
    • Data length must be divisible by 4
    • String encoding must be UTF-8
Returns
  • string - encoded data
  • null - when data length is not divisible by 4

decode(string: string): Uint8Array | null

Decode data with the Z85 codec

Parameters
  • string - string to decode
    • Length must be divisible by 5
    • Encoding must be UTF-8
Returns
  • Uint8Array - decoded string
  • null - when data length is not divisible by 5 or string includes invalid characters

License

Licensed under the MIT License.

Keywords

FAQs

Last updated on 12 Sep 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc