Skip to content

Commit 7f61f9b

Browse files
v0.4.2
1 parent 164683a commit 7f61f9b

Some content is hidden

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

60 files changed

+310
-326
lines changed

README.md

Lines changed: 102 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,108 @@ There are other good solutions for e.g. Base32, Base64, Base85, but BaseEx has t
1010
The **Ex** in the name stands for **Ex**ponent (of n) or - as read out loud - for an **X**.
1111

1212

13-
### Available converters:
14-
* ``Base1/Unary``
15-
* ``Base16``
16-
* ``Base32 (RFC 3548 and RFC 4648)``
17-
* ``Base58 (default, bitcoin, flickr)``
18-
* ``Base64 (standard and urlsafe)``
19-
* ``Base85 (adobe, ascii85, z85)``
20-
* ``Base91``
21-
* ``LEB128``
22-
* ``SimpleBase (Base2-Base36)``
23-
* ``ByteConverter``
13+
### Available converters/charsets:
14+
15+
<table>
16+
<thead>
17+
<tr><th><h4>converter</h4></th><th><h4>charsets</h4></th></tr>
18+
</thead>
19+
<tbody>
20+
<tr>
21+
<td>Base1/Unary</td>
22+
<td>
23+
<ul>
24+
<li>all</li>
25+
<li>sequence</li>
26+
<li>default</li>
27+
<li>tmark</li>
28+
</ul>
29+
</td>
30+
</tr>
31+
<tr>
32+
<td>Base16</td>
33+
<td>
34+
<ul>
35+
<li>default</li>
36+
</ul>
37+
</td>
38+
</tr>
39+
<tr>
40+
<td>Base32</td>
41+
<td>
42+
<ul>
43+
<li>crockford</li>
44+
<li>rfc3548</li>
45+
<li>rfc4648</li>
46+
<li>zbase32</li>
47+
</ul>
48+
</td>
49+
</tr>
50+
<tr>
51+
<td>Base58</td>
52+
<td>
53+
<ul>
54+
<li>default</li>
55+
<li>bitcoin</li>
56+
<li>flickr</li>
57+
</ul>
58+
</td>
59+
</tr>
60+
<tr>
61+
<td>Base64</td>
62+
<td>
63+
<ul>
64+
<li>standard</li>
65+
<li>urlsafe</li>
66+
</ul>
67+
</td>
68+
</tr>
69+
<tr>
70+
<td>Base85</td>
71+
<td>
72+
<ul>
73+
<li>adobe</li>
74+
<li>ascii85</li>
75+
<li>rfc1924 <i>(charset only)</i></li>
76+
<li>z85</li>
77+
</ul>
78+
</td>
79+
</tr>
80+
<tr>
81+
<td>Base91</td>
82+
<td>
83+
<ul>
84+
<li>default</li>
85+
</ul>
86+
</td>
87+
</tr>
88+
<tr>
89+
<td>LEB128</td>
90+
<td>
91+
<ul>
92+
<li>default</li>
93+
<li>hex</li>
94+
</ul>
95+
</td>
96+
</tr>
97+
<tr>
98+
<td>SimpleBase (Base2-Base36)</td>
99+
<td>
100+
<ul>
101+
<li>default</li>
102+
</ul>
103+
</td>
104+
</tr>
105+
<tr>
106+
<td>ByteConverter</td>
107+
<td>
108+
---
109+
</td>
110+
</tr>
111+
</tbody>
112+
</table>
113+
114+
_Additional charsets can be added. Watch this [live example](https://umamiappearance.github.io/BaseExJS/examples/live-examples.html#charsets)._
24115

25116

26117
## Installation

cjs/base-ex.cjs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ class Utils {
587587
if (charset.size === setLen) {
588588
charset = [...charset].join("");
589589
this.root.charsets[name] = charset;
590-
console.log(`New charset added with the name '${name}' added and ready to use`);
590+
console.info(`New charset '${name}' was added and is ready to use`);
591591
} else if (inputLen === setLen) {
592592
throw new Error("There were repetitive chars found in your charset. Make sure each char is unique.");
593593
} else {
@@ -597,7 +597,7 @@ class Utils {
597597

598598
// Save method (argument gets validated) to
599599
// change the default version.
600-
this.root.setDefaultVersion = (version) => {
600+
this.root.setDefaultCharset = (version) => {
601601
({version } = this.validateArgs([version]));
602602
this.root.version = version;
603603
};
@@ -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.1
1276+
* @version 0.4.2
12771277
* @author UmamiAppearance [mail@umamiappearance.eu]
12781278
* @license GPL-3.0
12791279
*/
@@ -1300,7 +1300,7 @@ class Base1 extends BaseTemplate {
13001300
// it is not suitable for this converter.
13011301
delete this.addCharset;
13021302

1303-
// All chars in the sting are used and picked randomly (prob. suitable for obfuscation)
1303+
// All chars in the string are used and picked randomly (prob. suitable for obfuscation)
13041304
this.charsets.all = " !\"#$%&'()*+,./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
13051305

13061306
// The sequence is used from left to right again and again
@@ -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.1
1435+
* @version 0.4.2
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.1
1514+
* @version 0.4.2
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.1
1613+
* @version 0.4.2
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.1
1751+
* @version 0.4.2
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.1
1838+
* @version 0.4.2
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.1
1967+
* @version 0.4.2
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.1
2176+
* @version 0.4.2
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.1
2286+
* @version 0.4.2
22872287
* @author UmamiAppearance [mail@umamiappearance.eu]
22882288
* @license GPL-3.0
22892289
*/
@@ -2447,7 +2447,7 @@ class LEB128 extends BaseTemplate {
24472447
/**
24482448
* [BaseEx|SimpleBase Converter]{@link https://github.com/UmamiAppearance/BaseExJS/blob/main/src/converters/leb-128.js}
24492449
*
2450-
* @version 0.4.1
2450+
* @version 0.4.2
24512451
* @author UmamiAppearance [mail@umamiappearance.eu]
24522452
* @license GPL-3.0
24532453
*/
@@ -2505,10 +2505,10 @@ class SimpleBase extends BaseTemplate {
25052505
}
25062506
}
25072507

2508-
/*
2508+
/**
25092509
* [BaseEx]{@link https://github.com/UmamiAppearance/BaseExJS}
25102510
*
2511-
* @version 0.4.1
2511+
* @version 0.4.2
25122512
* @author UmamiAppearance [mail@umamiappearance.eu]
25132513
* @license GPL-3.0 AND BSD-3-Clause (only regarding Base91, Copyright (c) 2000-2006 Joachim Henke)
25142514
*/
@@ -2549,8 +2549,8 @@ class BaseEx {
25492549
this.base58_flickr = new Base58("flickr", outputType);
25502550
this.base64 = new Base64("default", outputType);
25512551
this.base64_urlsafe = new Base64("urlsafe", outputType);
2552-
this.base85adobe = new Base85("adobe", outputType);
2553-
this.base85ascii = new Base85("ascii85", outputType);
2552+
this.base85_adobe = new Base85("adobe", outputType);
2553+
this.base85_ascii = new Base85("ascii85", outputType);
25542554
this.base85_z85 = new Base85("z85", outputType);
25552555
this.base91 = new Base91("default",outputType);
25562556
this.leb128 = new LEB128("default", outputType);

0 commit comments

Comments
 (0)