···1+# ChangeLog
2+3+## 2.1.0 - 2025-08-03
4+5+### Changed
6+7+- when fields are CHOICEs now both the field name and the choice name are shown (fixes GitHub #102)
8+- upgrade minimum NodeJS version supported from 12.20.0 to 14.6.0 due to usage of ?. and ?? operators in defs.js (ECMAScript 2020); older code is still linted against ECMAScript 2015 for now
9+10+### Added
11+12+- add tests to check expected decoding
13+14+## 2.0.6 - 2025-07-29
15+16+### Added
17+18+- add proper support for standard Base64 (we previously only supported Base64url) (fixes GitHub #99)
19+- improve test harness
20+21+## 2.0.5 - 2025-04-12
22+23+### Added
24+25+- add `index-local.html` for local `file://` usage without needing a web server
26+- add definitions support for `LDAPMessage`
27+- #TODO continue producing old ChangeLog entries
···86 if (area.value === '') area.value = Base64.pretty(b64);
87 try {
88 window.location.hash = hash = '#' + b64;
89- } catch (e) {
90 // fails with "Access Denied" on IE with URLs longer than ~2048 chars
91 window.location.hash = hash = '#';
92 }
···122 else if (Base64.re.test(str)) der = Base64.unarmor(str);
123 else der = str;
124 decode(der);
125- } catch (e) {
126 text(tree, 'Cannot decode file.');
127 dump.innerHTML = '';
128 }
···86 if (area.value === '') area.value = Base64.pretty(b64);
87 try {
88 window.location.hash = hash = '#' + b64;
89+ } catch (ignore) {
90 // fails with "Access Denied" on IE with URLs longer than ~2048 chars
91 window.location.hash = hash = '#';
92 }
···122 else if (Base64.re.test(str)) der = Base64.unarmor(str);
123 else der = str;
124 decode(der);
125+ } catch (ignore) {
126 text(tree, 'Cannot decode file.');
127 dump.innerHTML = '';
128 }
+13-7
int10.js
···13// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1516-let max = 10000000000000; // biggest 10^n integer that can still fit 2^53 when multiplied by 256
01718export class Int10 {
19 /**
···2627 /**
28 * Multiply value by m and add c.
29- * @param {number} m - multiplier, must be < =256
30- * @param {number} c - value to add
31 */
32 mulAdd(m, c) {
033 // assert(m <= 256)
034 let b = this.buf,
35 l = b.length,
36 i, t;
···7172 /**
73 * Convert to decimal string representation.
74- * @param {*} base - optional value, only value accepted is 10
075 */
76- toString(base) {
77- if ((base || 10) != 10)
78- throw 'only base 10 is supported';
79 let b = this.buf,
80 s = b[b.length - 1].toString();
81 for (let i = b.length - 2; i >= 0; --i)
···86 /**
87 * Convert to Number value representation.
88 * Will probably overflow 2^53 and thus become approximate.
089 */
90 valueOf() {
91 let b = this.buf,
···9798 /**
99 * Return value as a simple Number (if it is <= 10000000000000), or return this.
0100 */
101 simplify() {
102 let b = this.buf;
···13// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1516+/** Biggest 10^n integer that can still fit 2^53 when multiplied by 256. */
17+const max = 10000000000000;
1819export class Int10 {
20 /**
···2728 /**
29 * Multiply value by m and add c.
30+ * @param {number} m - multiplier, must be 0<m<=256
31+ * @param {number} c - value to add, must be c>=0
32 */
33 mulAdd(m, c) {
34+ // assert(m > 0)
35 // assert(m <= 256)
36+ // assert(c >= 0)
37 let b = this.buf,
38 l = b.length,
39 i, t;
···7475 /**
76 * Convert to decimal string representation.
77+ * @param {number} [base=10] - optional value, only value accepted is 10
78+ * @returns {string} The decimal string representation.
79 */
80+ toString(base = 10) {
81+ if (base != 10)
82+ throw new Error('only base 10 is supported');
83 let b = this.buf,
84 s = b[b.length - 1].toString();
85 for (let i = b.length - 2; i >= 0; --i)
···90 /**
91 * Convert to Number value representation.
92 * Will probably overflow 2^53 and thus become approximate.
93+ * @returns {number} The numeric value.
94 */
95 valueOf() {
96 let b = this.buf,
···102103 /**
104 * Return value as a simple Number (if it is <= 10000000000000), or return this.
105+ * @returns {number | Int10} The simplified value.
106 */
107 simplify() {
108 let b = this.buf;