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

@etclabscore/eserialize

Package Overview
Dependencies
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@etclabscore/eserialize

This goal if this module is to provide easy functions to serialize and deserialize data for the Ethereum Stack.

  • 1.1.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
12
increased by100%
Maintainers
4
Weekly downloads
 
Created
Source

eserialize

This goal of this module is to provide easy functions to serialize and deserialize data for the Ethereum Stack.

Usage

npm install @etclabscore/eserialize --save

Examples

Serialize
import { stringToHex, dateToHex, numberToHex } from "@etclabscore/eserialize";

stringToHex("foo");
// "0x666F6F"

dateToHex(new Date("2019-09-28T22:47:08.000Z"));
// "0x5d8fe2ec"

numberToHex(0);
// "0x0"
Deserialize
import { hexToString, hexToDate, hexToNumber } from "@etclabscore/eserialize";

hexToString("0x666F6F");
// "foo"

hexToDate("0x5d8fe2ec").toISOString();
// "2019-09-28T22:47:08.000Z"

hexToNumber("0x0");
// 0

hexToNumber("0x1");
// 1

hexToNumber("0x878328");
// 8880936

Contributing

How to contribute, build and release are outlined in CONTRIBUTING.md, BUILDING.md and RELEASING.md respectively. Commits in this repository follow the CONVENTIONAL_COMMITS.md specification.

FAQs

Package last updated on 13 May 2020

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