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

bytewise

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bytewise

Binary serialization which sorts bytewise for arbirarily complex data structures

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
345K
decreased by-12.03%
Maintainers
1
Weekly downloads
 
Created

What is bytewise?

The bytewise npm package is a utility for encoding and decoding data into lexicographically sortable byte arrays. It is particularly useful for creating keys for databases that need to maintain a specific order.

What are bytewise's main functionalities?

Encoding Data

This feature allows you to encode various types of data (e.g., strings, numbers, booleans) into a lexicographically sortable byte array.

const bytewise = require('bytewise');
const encoded = bytewise.encode(['example', 123, true]);
console.log(encoded);

Decoding Data

This feature allows you to decode a previously encoded byte array back into its original data format.

const bytewise = require('bytewise');
const encoded = bytewise.encode(['example', 123, true]);
const decoded = bytewise.decode(encoded);
console.log(decoded);

Custom Encoding

This feature allows you to define custom encoding and decoding logic for specific data types.

const bytewise = require('bytewise');
const customEncoder = bytewise.encodeCustom({ type: 'custom', encode: (x) => Buffer.from(x), decode: (x) => x.toString() });
const encoded = customEncoder.encode('customData');
console.log(encoded);

Other packages similar to bytewise

Keywords

FAQs

Package last updated on 19 Jun 2015

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