MCPcopy Create free account
hub / github.com/ccxt/ccxt / getExtendedDecimalToBase16

Method getExtendedDecimalToBase16

ts/src/extended.ts:3391–3409  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

3389 }
3390
3391 getExtendedDecimalToBase16 (value) {
3392 let decimalString = '';
3393 if (typeof value === 'string') {
3394 decimalString = value;
3395 } else {
3396 decimalString = this.numberToString (value);
3397 }
3398 const hexChars = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' ];
3399 let result = '';
3400 while (Precise.stringGt (decimalString, '0')) {
3401 const remainder = this.parseToInt (Precise.stringMod (decimalString, '16'));
3402 result = hexChars[remainder] + result;
3403 decimalString = Precise.stringDiv (decimalString, '16', 0);
3404 }
3405 if (result === '') {
3406 return '0';
3407 }
3408 return result;
3409 }
3410
3411 getExtendedSignatureHex (signature) {
3412 if (typeof signature === 'string') {

Callers 1

Calls 5

numberToStringMethod · 0.45
stringGtMethod · 0.45
parseToIntMethod · 0.45
stringModMethod · 0.45
stringDivMethod · 0.45

Tested by

no test coverage detected