bufferbase 1.0.1 → 1.0.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/package.json +2 -4
- package/src/sample.ts +12 -12
- package/tsconfig.json +2 -2
package/package.json
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bufferbase",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Buffer-to-BaseN Encoder, Decoder, Converter, and Validator",
|
|
5
|
-
"
|
|
6
|
-
"module": "./esm/index.js",
|
|
7
|
-
"types": "./esm/index.d.ts",
|
|
5
|
+
"type": "module",
|
|
8
6
|
"sideEffects": false,
|
|
9
7
|
"exports": "./dist/index.js",
|
|
10
8
|
"scripts": {
|
package/src/sample.ts
CHANGED
|
@@ -17,7 +17,7 @@ const base64encoded = converter_58to64.convert(base58encoded);
|
|
|
17
17
|
|
|
18
18
|
// Validating Base64
|
|
19
19
|
const validatorB64 = new Validator(Chars.Base64_URL_SAFE);
|
|
20
|
-
const
|
|
20
|
+
const isValidAsBase64 = validatorB64.validate(base64encoded);
|
|
21
21
|
|
|
22
22
|
// Decoding Base64
|
|
23
23
|
const decoder = new BufferEncoder(Chars.Base64_URL_SAFE);
|
|
@@ -28,16 +28,16 @@ console.table({
|
|
|
28
28
|
base32encoded,
|
|
29
29
|
base58encoded,
|
|
30
30
|
base64encoded,
|
|
31
|
-
|
|
31
|
+
isValidAsBase64,
|
|
32
32
|
decoded: decoded.toString("utf8"),
|
|
33
33
|
});
|
|
34
|
-
//
|
|
35
|
-
// │
|
|
36
|
-
//
|
|
37
|
-
// │
|
|
38
|
-
// │ base32encoded
|
|
39
|
-
// │ base58encoded
|
|
40
|
-
// │ base64encoded
|
|
41
|
-
// │
|
|
42
|
-
// │
|
|
43
|
-
//
|
|
34
|
+
// ┌─────────────────┬─────────────────────────┐
|
|
35
|
+
// │ (index) │ Values │
|
|
36
|
+
// ├─────────────────┼─────────────────────────┤
|
|
37
|
+
// │ bytes │ 'Hello, World!' │
|
|
38
|
+
// │ base32encoded │ '4GSBCDHQJR82QDXS6RS11' │
|
|
39
|
+
// │ base58encoded │ '72k1xXWG59fYdzSNoA' │
|
|
40
|
+
// │ base64encoded │ 'BIZWxsbywgV29ybGQh' │
|
|
41
|
+
// │ isValidAsBase64 │ true │
|
|
42
|
+
// │ decoded │ 'Hello, World!' │
|
|
43
|
+
// └─────────────────┴─────────────────────────┘
|