bn.js 4.12.1 → 4.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bn.js +6 -0
- package/package.json +1 -1
package/lib/bn.js
CHANGED
|
@@ -1921,6 +1921,7 @@
|
|
|
1921
1921
|
this.words[i] = carry;
|
|
1922
1922
|
this.length++;
|
|
1923
1923
|
}
|
|
1924
|
+
this.length = num === 0 ? 1 : this.length;
|
|
1924
1925
|
|
|
1925
1926
|
return this;
|
|
1926
1927
|
};
|
|
@@ -2128,6 +2129,11 @@
|
|
|
2128
2129
|
this.words[this.length - 1] &= mask;
|
|
2129
2130
|
}
|
|
2130
2131
|
|
|
2132
|
+
if (this.length === 0) {
|
|
2133
|
+
this.words[0] = 0;
|
|
2134
|
+
this.length = 1;
|
|
2135
|
+
}
|
|
2136
|
+
|
|
2131
2137
|
return this.strip();
|
|
2132
2138
|
};
|
|
2133
2139
|
|