MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxBigIntParseX

Function fxBigIntParseX

xs/sources/xsBigInt.c:504–522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502}
503
504void fxBigIntParseX(txBigInt* bigint, txString p, txSize length)
505{
506 txU4 data[1] = { 0 };
507 txBigInt digit = { .sign=0, .size=1, .data=data };
508 bigint->sign = 0;
509 bigint->size = 1;
510 bigint->data[0] = 0;
511 while (length) {
512 char c = *p++;
513 if (('0' <= c) && (c <= '9'))
514 data[0] = c - '0';
515 else if (('a' <= c) && (c <= 'f'))
516 data[0] = 10 + c - 'a';
517 else
518 data[0] = 10 + c - 'A';
519 fxBigInt_uadd(NULL, bigint, fxBigInt_ulsl1(NULL, bigint, bigint, 4), &digit);
520 length--;
521 }
522}
523
524#ifndef mxCompile
525

Callers 2

fxGetNextNumberXFunction · 0.85
fxStringToBigIntFunction · 0.85

Calls 2

fxBigInt_uaddFunction · 0.85
fxBigInt_ulsl1Function · 0.85

Tested by

no test coverage detected