Skip to content

Commit fd5f66c

Browse files
v0.4.1
1 parent 6e8e111 commit fd5f66c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+277
-198
lines changed

cjs/base-ex.cjs

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ class SmartInput {
277277
else if (Array.isArray(input)) {
278278
const collection = new Array();
279279
for (const elem of input) {
280-
collection.push(...this.toBytes(elem));
280+
collection.push(...this.toBytes(elem, settings)[0]);
281281
}
282282
inputUint8 = Uint8Array.from(collection);
283283
}
@@ -1273,7 +1273,7 @@ class BaseTemplate {
12731273
/**
12741274
* [BaseEx|Base1 Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/base-1.js}
12751275
*
1276-
* @version 0.4.0
1276+
* @version 0.4.1
12771277
* @author UmamiAppearance [mail@umamiappearance.eu]
12781278
* @license GPL-3.0
12791279
*/
@@ -1432,7 +1432,7 @@ class Base1 extends BaseTemplate {
14321432
/**
14331433
* [BaseEx|Base16 Converter]{@link https://github.com/UmamiAppearance/BaseExJS/src/converters/base-16.js}
14341434
*
1435-
* @version 0.4.0
1435+
* @version 0.4.1
14361436
* @author UmamiAppearance [mail@umamiappearance.eu]
14371437
* @license GPL-3.0
14381438
*/
@@ -1511,7 +1511,7 @@ class Base16 extends BaseTemplate {
15111511
/**
15121512
* [BaseEx|Base32 Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/base-32.js}
15131513
*
1514-
* @version 0.4.0
1514+
* @version 0.4.1
15151515
* @author UmamiAppearance [mail@umamiappearance.eu]
15161516
* @license GPL-3.0
15171517
*/
@@ -1610,7 +1610,7 @@ class Base32 extends BaseTemplate {
16101610
/**
16111611
* [BaseEx|Base58 Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/base-58.js}
16121612
*
1613-
* @version 0.4.0
1613+
* @version 0.4.1
16141614
* @author UmamiAppearance [mail@umamiappearance.eu]
16151615
* @license GPL-3.0
16161616
*/
@@ -1748,7 +1748,7 @@ class Base58 extends BaseTemplate{
17481748
/**
17491749
* [BaseEx|Base64 Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/base-64.js}
17501750
*
1751-
* @version 0.4.0
1751+
* @version 0.4.1
17521752
* @author UmamiAppearance [mail@umamiappearance.eu]
17531753
* @license GPL-3.0
17541754
*/
@@ -1835,7 +1835,7 @@ class Base64 extends BaseTemplate {
18351835
/**
18361836
* [BaseEx|Base85 Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/base-85.js}
18371837
*
1838-
* @version 0.4.0
1838+
* @version 0.4.1
18391839
* @author UmamiAppearance [mail@umamiappearance.eu]
18401840
* @license GPL-3.0
18411841
*/
@@ -1964,7 +1964,7 @@ class Base85 extends BaseTemplate {
19641964
/**
19651965
* [BaseEx|Base91 Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/base-91.js}
19661966
*
1967-
* @version 0.4.0
1967+
* @version 0.4.1
19681968
* @author UmamiAppearance [mail@umamiappearance.eu]
19691969
* @license GPL-3.0 AND BSD-3-Clause (Base91, Copyright (c) 2000-2006 Joachim Henke)
19701970
*/
@@ -2173,7 +2173,7 @@ class Base91 extends BaseTemplate {
21732173
/**
21742174
* [BaseEx|Byte Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/byte-converter.js}
21752175
*
2176-
* @version 0.4.0
2176+
* @version 0.4.1
21772177
* @author UmamiAppearance [mail@umamiappearance.eu]
21782178
* @license GPL-3.0
21792179
*/
@@ -2283,7 +2283,7 @@ class ByteConverter {
22832283
/**
22842284
* [BaseEx|LEB128 Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/leb-128.js}
22852285
*
2286-
* @version 0.4.0
2286+
* @version 0.4.1
22872287
* @author UmamiAppearance [mail@umamiappearance.eu]
22882288
* @license GPL-3.0
22892289
*/
@@ -2444,6 +2444,14 @@ class LEB128 extends BaseTemplate {
24442444
}
24452445
}
24462446

2447+
/**
2448+
* [BaseEx|SimpleBase Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/leb-128.js}
2449+
*
2450+
* @version 0.4.1
2451+
* @author UmamiAppearance [mail@umamiappearance.eu]
2452+
* @license GPL-3.0
2453+
*/
2454+
24472455
class SimpleBase extends BaseTemplate {
24482456
constructor(radix, ...args) {
24492457
super();
@@ -2452,14 +2460,14 @@ class SimpleBase extends BaseTemplate {
24522460
throw new RangeError("Radix argument must be provided and has to be an integer between 2 and 36.")
24532461
}
24542462

2455-
this.charsets.selection = "0123456789abcdefghijklmnopqrstuvwxyz".substring(0, radix);
2463+
this.charsets.default = "0123456789abcdefghijklmnopqrstuvwxyz".substring(0, radix);
24562464

24572465
// predefined settings
24582466
this.converter = new BaseConverter(radix, 0, 0);
24592467
this.hasSignedMode = true;
24602468
this.littleEndian = !(radix === 2 || radix === 16);
24612469
this.signed = true;
2462-
this.version = "selection";
2470+
this.version = "default";
24632471

24642472
// list of allowed/disallowed args to change
24652473
this.isMutable.littleEndian = true,
@@ -2500,7 +2508,7 @@ class SimpleBase extends BaseTemplate {
25002508
/*
25012509
* [BaseEx]{@link https://github.com/UmamiAppearance/BaseExJS}
25022510
*
2503-
* @version 0.4.0
2511+
* @version 0.4.1
25042512
* @author UmamiAppearance [mail@umamiappearance.eu]
25052513
* @license GPL-3.0 AND BSD-3-Clause (only regarding Base91, Copyright (c) 2000-2006 Joachim Henke)
25062514
*/

dist/base-ex.esm.js

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ class SmartInput {
273273
else if (Array.isArray(input)) {
274274
const collection = new Array();
275275
for (const elem of input) {
276-
collection.push(...this.toBytes(elem));
276+
collection.push(...this.toBytes(elem, settings)[0]);
277277
}
278278
inputUint8 = Uint8Array.from(collection);
279279
}
@@ -1269,7 +1269,7 @@ class BaseTemplate {
12691269
/**
12701270
* [BaseEx|Base1 Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/base-1.js}
12711271
*
1272-
* @version 0.4.0
1272+
* @version 0.4.1
12731273
* @author UmamiAppearance [mail@umamiappearance.eu]
12741274
* @license GPL-3.0
12751275
*/
@@ -1428,7 +1428,7 @@ class Base1 extends BaseTemplate {
14281428
/**
14291429
* [BaseEx|Base16 Converter]{@link https://github.com/UmamiAppearance/BaseExJS/src/converters/base-16.js}
14301430
*
1431-
* @version 0.4.0
1431+
* @version 0.4.1
14321432
* @author UmamiAppearance [mail@umamiappearance.eu]
14331433
* @license GPL-3.0
14341434
*/
@@ -1507,7 +1507,7 @@ class Base16 extends BaseTemplate {
15071507
/**
15081508
* [BaseEx|Base32 Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/base-32.js}
15091509
*
1510-
* @version 0.4.0
1510+
* @version 0.4.1
15111511
* @author UmamiAppearance [mail@umamiappearance.eu]
15121512
* @license GPL-3.0
15131513
*/
@@ -1606,7 +1606,7 @@ class Base32 extends BaseTemplate {
16061606
/**
16071607
* [BaseEx|Base58 Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/base-58.js}
16081608
*
1609-
* @version 0.4.0
1609+
* @version 0.4.1
16101610
* @author UmamiAppearance [mail@umamiappearance.eu]
16111611
* @license GPL-3.0
16121612
*/
@@ -1744,7 +1744,7 @@ class Base58 extends BaseTemplate{
17441744
/**
17451745
* [BaseEx|Base64 Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/base-64.js}
17461746
*
1747-
* @version 0.4.0
1747+
* @version 0.4.1
17481748
* @author UmamiAppearance [mail@umamiappearance.eu]
17491749
* @license GPL-3.0
17501750
*/
@@ -1831,7 +1831,7 @@ class Base64 extends BaseTemplate {
18311831
/**
18321832
* [BaseEx|Base85 Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/base-85.js}
18331833
*
1834-
* @version 0.4.0
1834+
* @version 0.4.1
18351835
* @author UmamiAppearance [mail@umamiappearance.eu]
18361836
* @license GPL-3.0
18371837
*/
@@ -1960,7 +1960,7 @@ class Base85 extends BaseTemplate {
19601960
/**
19611961
* [BaseEx|Base91 Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/base-91.js}
19621962
*
1963-
* @version 0.4.0
1963+
* @version 0.4.1
19641964
* @author UmamiAppearance [mail@umamiappearance.eu]
19651965
* @license GPL-3.0 AND BSD-3-Clause (Base91, Copyright (c) 2000-2006 Joachim Henke)
19661966
*/
@@ -2169,7 +2169,7 @@ class Base91 extends BaseTemplate {
21692169
/**
21702170
* [BaseEx|Byte Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/byte-converter.js}
21712171
*
2172-
* @version 0.4.0
2172+
* @version 0.4.1
21732173
* @author UmamiAppearance [mail@umamiappearance.eu]
21742174
* @license GPL-3.0
21752175
*/
@@ -2279,7 +2279,7 @@ class ByteConverter {
22792279
/**
22802280
* [BaseEx|LEB128 Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/leb-128.js}
22812281
*
2282-
* @version 0.4.0
2282+
* @version 0.4.1
22832283
* @author UmamiAppearance [mail@umamiappearance.eu]
22842284
* @license GPL-3.0
22852285
*/
@@ -2440,6 +2440,14 @@ class LEB128 extends BaseTemplate {
24402440
}
24412441
}
24422442

2443+
/**
2444+
* [BaseEx|SimpleBase Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/leb-128.js}
2445+
*
2446+
* @version 0.4.1
2447+
* @author UmamiAppearance [mail@umamiappearance.eu]
2448+
* @license GPL-3.0
2449+
*/
2450+
24432451
class SimpleBase extends BaseTemplate {
24442452
constructor(radix, ...args) {
24452453
super();
@@ -2448,14 +2456,14 @@ class SimpleBase extends BaseTemplate {
24482456
throw new RangeError("Radix argument must be provided and has to be an integer between 2 and 36.")
24492457
}
24502458

2451-
this.charsets.selection = "0123456789abcdefghijklmnopqrstuvwxyz".substring(0, radix);
2459+
this.charsets.default = "0123456789abcdefghijklmnopqrstuvwxyz".substring(0, radix);
24522460

24532461
// predefined settings
24542462
this.converter = new BaseConverter(radix, 0, 0);
24552463
this.hasSignedMode = true;
24562464
this.littleEndian = !(radix === 2 || radix === 16);
24572465
this.signed = true;
2458-
this.version = "selection";
2466+
this.version = "default";
24592467

24602468
// list of allowed/disallowed args to change
24612469
this.isMutable.littleEndian = true,
@@ -2496,7 +2504,7 @@ class SimpleBase extends BaseTemplate {
24962504
/*
24972505
* [BaseEx]{@link https://github.com/UmamiAppearance/BaseExJS}
24982506
*
2499-
* @version 0.4.0
2507+
* @version 0.4.1
25002508
* @author UmamiAppearance [mail@umamiappearance.eu]
25012509
* @license GPL-3.0 AND BSD-3-Clause (only regarding Base91, Copyright (c) 2000-2006 Joachim Henke)
25022510
*/

0 commit comments

Comments
 (0)