0.1.2 • Published 7 years ago

int64-convert v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

int64-convert

Description

convert int64 number (display as string) between two scales

Installation

npm install int64-convert

Examples

var convert = require("int64-convert");

// unsigned
convert('7fffffffffffffff', 16, 10); // '9223372036854775807'
convert('9223372036854775807', 10, 16); // '7fffffffffffffff'
convert('7fffffffffffffff', 16, 2); // '111111111111111111111111111111111111111111111111111111111111111'
convert('9223372036854775807', 10, 2); // '111111111111111111111111111111111111111111111111111111111111111'

// polish int64 value
convert('4660', 10, 16, 8); // '00001234'
convert('4660', 10, 16, 16); // '0000000000001234'

// signed
convert.signedHexToDec('ffffffffffffffff'); // '-1'
convert.signedDecToHex('-1'); // 'ffffffffffffffff'

Tests

npm install
npm test
0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago