UNPKG

@signumjs/util

Version:

Useful utilities and tools for building Signum Network applications

21 lines (20 loc) 760 B
/** Original work Copyright (c) 2020 Burst Apps Team */ import './internal/padStartPolyfill'; import BigNumber from 'bignumber.js'; /** * Arbitrary length decimal to hexadecimal conversion * * > Negative numbers are expressed as Two's Complement (https://en.wikipedia.org/wiki/Two%27s_complement) * * Credits to AJ ONeal for the two's complements stuff * https://coolaj86.com/articles/convert-decimal-to-hex-with-js-bigints/ * * @param decimal A decimal string or BigNumber representation * @param padding If set the hex string will be padded to given number, 8 or 16 or more * @return A hexadecimal string * * @category conversion */ export declare const convertDecStringToHexString: (decimal: BigNumber | string, padding?: number) => string;