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

bcd

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bcd

binary coded decimals

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bcd

binary coded decimals

Installation

npm install bcd

Usage

  • bcd.encode(num) — encode given number into a buffer with a minimal length that fits the result;
  • bcd.encode(num, length) — encode given number into a buffer with a given length. If length is more than needed, the result is aligned at the right side of the buffer and the rest is filled with zeroes. If length is less then needed, the result is truncated from the left side;
  • bcd.encode(num, buffer) — encode givento number into a given buffer. The above rules regarding length are applied.
  • bcd.decode(buffer) — decode given buffer into a number. If the buffer is not a valid BCD, this method throws.

license

MIT

FAQs

Package last updated on 08 Apr 2014

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