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 - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

.travis.yml

5

index.js

@@ -86,5 +86,6 @@ /**

function decToHex(decStr) {
function decToHex(decStr, opts) {
var hidePrefix = opts && opts.prefix === false;
var hex = convertBase(decStr, 10, 16);
return hex ? '0x' + hex : null;
return hex ? (hidePrefix ? hex : '0x' + hex) : null;
}

@@ -91,0 +92,0 @@

2

package.json
{
"name": "hex2dec",
"version": "1.0.1",
"version": "1.1.0",
"description": "Arbitrary precision decimal/hexadecimal converter.",

@@ -5,0 +5,0 @@ "main": "index.js",

# hex2dec
[![Latest NPM release](https://img.shields.io/npm/v/hex2dec.svg)](https://www.npmjs.com/package/hex2dec)
[![License](https://img.shields.io/npm/l/hex2dec.svg)](https://github.com/donmccurdy/hex2dec/blob/master/LICENSE)
[![Build Status](https://travis-ci.com/donmccurdy/hex2dec.svg?branch=master)](https://travis-ci.com/donmccurdy/hex2dec)
Arbitrary precision decimal↔️hexadecimal converter, from a [blog post](http://www.danvk.org/hex2dec.html) by [Dan Vanderkam](https://github.com/danvk).

@@ -14,4 +18,5 @@

var hex = converter.hexToDec('0xFA'); // 250
var dec = converter.decToHex('250'); // '0xfa'
var dec = converter.hexToDec('0xFA'); // 250
var hex = converter.decToHex('250'); // '0xfa'
var hexString = converter.decToHex('250', { prefix: false }); // 'fa'
```

@@ -18,0 +23,0 @@

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