Socket
Socket
Sign inDemoInstall

hex2dec

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hex2dec

Arbitrary precision decimal/hexadecimal converter.


Version published
Weekly downloads
300K
increased by4.29%
Maintainers
1
Weekly downloads
 
Created

What is hex2dec?

The hex2dec npm package provides utilities for converting hexadecimal numbers to decimal and vice versa. It is useful for applications that need to handle numerical data in different bases, particularly in fields like computer science, electronics, and data encoding.

What are hex2dec's main functionalities?

Hexadecimal to Decimal Conversion

This feature allows you to convert a hexadecimal string to its decimal equivalent. In the example, the hexadecimal '1A' is converted to the decimal number 26.

const hex2dec = require('hex2dec');
const decimal = hex2dec.hexToDec('1A');
console.log(decimal); // Output: 26

Decimal to Hexadecimal Conversion

This feature allows you to convert a decimal number to its hexadecimal string equivalent. In the example, the decimal number 26 is converted to the hexadecimal '1A'.

const hex2dec = require('hex2dec');
const hex = hex2dec.decToHex(26);
console.log(hex); // Output: '1A'

Other packages similar to hex2dec

Keywords

FAQs

Package last updated on 04 Dec 2018

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