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

@etomon/encode-tools

Package Overview
Dependencies
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@etomon/encode-tools

This package aggregates different libraries for encoding, serializing, generating ids and hashing things, exposing a common interface.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
2
Weekly downloads
 
Created
Source

Etomon Encode Tools

This package aggregates different libraries for encoding, serializing, generating ids and hashing things, exposing a common interface.

Many other packages serve the same purpose, but our objective is to ensure a consistent experience in both node.js and the browser and standardize the api so functions work the same way across different underlying libraries.

Algorithms

Below are a list of supported algorithms, their backing library, and their support in the browser.

Binary Encoding

NameBrowser?Underlying Package
nodeBufferbuffer
base64(built-in)
base64url(built-in)
hex(built-in)
base32base32.js
hashidshashids
arrayBuffer(built-in)

Hashing

NameBrowser?Underlying Package
crc32hash-wasm
xxhash3xxhash-addon
xxhash64xxhash-addon/hash-wasm
xxhash32xxhash-addon/hash-wasm
md5hash-wasm
sha1hash-wasm
sha2hash-wasm
sha3hash-wasm
bcrypthash-wasm

ID Generation

NameBrowser?Underlying Package
uuidv4uuid
uuidv2uuid
uuidv4stringuuid
uuidv2stringuuid
objectIdbson-ext/bson
nanoidnanoid
timestamp(built in)

Serialization

NameBrowser?Underlying Package
json(built in)
msgpack@msgpack/msgpack
bsonbson-ext/bson

Requirements

Etomon Encode Tools runs in the browser and in node.js, with two exceptions. The bson-ext and xxhash-addon packages have native bindings, and so cannot run in the browser. For browser compatibility, the EncodeTools class uses the pure javascript bson and hash-wsam packages to provide equivalent support albeit at the cost of performance. Additionally, hash-wsam lacks support for xxhash3.

The EncodeToolsNative class will use the native packages bson-ext and xxhash-addon (and any future native packages). bson-ext and xxhash-addon are listed as peer dependencies, so they must be installed manually with npm install --no-save bson-ext xxhash-addon.

Usage

Please see the documentation located at https://etomonusa.github.io/encode-tools/

Generally speaking, all functions return a Buffer.

License

Etomon Encode Tools is licensed under the GNU LGPL-3.0, a copy of which can be found at https://www.gnu.org/licenses/.

FAQs

Package last updated on 07 May 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc