You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we parse strings to numbers using the Number constructor in some places. See comment #216 (comment). It looks like the eventing.ts usage needs replacing with parseInt(input, 16) to ensure we parse hex strings correctly. I don't think the tholder.ts needs changing to anything else, but it's worth having a look at it.
See current usage:
$ grep --line-number -A2 -B2 -E " Number\(" src/**/*.ts
src/keri/core/eventing.ts-68- }
src/keri/core/eventing.ts-69-
src/keri/core/eventing.ts:70: const sner = Number(sn);
src/keri/core/eventing.ts-71- if (sner < 1) {
src/keri/core/eventing.ts-72- throw new Error(`Invalid sn = 0x${sner.toString()} for rot or drt.`);
--
src/keri/core/tholder.ts-45- let sith = this.thold.map((clause: Fraction[]) => {
src/keri/core/tholder.ts-46- return clause.map((c) => {
src/keri/core/tholder.ts:47: if (0 < Number(c) && Number(c) < 1) {
src/keri/core/tholder.ts-48- return math.format(c, { fraction: 'ratio' });
src/keri/core/tholder.ts-49- } else {
--
src/keri/core/tholder.ts-201- for (const w of clause) {
src/keri/core/tholder.ts-202- if (sats[wio]) {
src/keri/core/tholder.ts:203: cw += Number(w);
src/keri/core/tholder.ts-204- }
src/keri/core/tholder.ts-205- wio += 1;
The text was updated successfully, but these errors were encountered:
Currently, we parse strings to numbers using the
Number
constructor in some places. See comment #216 (comment). It looks like theeventing.ts
usage needs replacing withparseInt(input, 16)
to ensure we parse hex strings correctly. I don't think thetholder.ts
needs changing to anything else, but it's worth having a look at it.See current usage:
The text was updated successfully, but these errors were encountered: