@robinpath/encode 0.1.0 → 0.1.1

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/README.md CHANGED
@@ -1,104 +1,104 @@
1
- # @robinpath/encode
2
-
3
- > Encoding and decoding conversions: Base64, Base32, hex, URL encoding, HTML entities, binary, ROT13, percent-encoding, and more
4
-
5
- ![Category](https://img.shields.io/badge/category-Utility-blue) ![Functions](https://img.shields.io/badge/functions-21-green) ![Auth](https://img.shields.io/badge/auth-none-lightgrey) ![License](https://img.shields.io/badge/license-MIT-brightgreen)
6
-
7
- ## Why use this module?
8
-
9
- The `encode` module lets you:
10
-
11
- - Encode a string or buffer to Base64
12
- - Decode a Base64-encoded string
13
- - Encode a string to URL-safe Base64 (no padding, +/ replaced with -_)
14
- - Decode a URL-safe Base64 string
15
- - Encode a string to hexadecimal representation
16
-
17
- All functions are callable directly from RobinPath scripts with a simple, consistent API.
18
-
19
- ## Installation
20
-
21
- ```bash
22
- npm install @robinpath/encode
23
- ```
24
-
25
- ## Quick Start
26
-
27
- No credentials needed — start using it right away:
28
-
29
- ```robinpath
30
- encode.base64Decode
31
- ```
32
-
33
- ## Available Functions
34
-
35
- | Function | Description |
36
- |----------|-------------|
37
- | `encode.base64Encode` | Encode a string or buffer to Base64 |
38
- | `encode.base64Decode` | Decode a Base64-encoded string |
39
- | `encode.base64UrlEncode` | Encode a string to URL-safe Base64 (no padding, +/ replaced with -_) |
40
- | `encode.base64UrlDecode` | Decode a URL-safe Base64 string |
41
- | `encode.hexEncode` | Encode a string to hexadecimal representation |
42
- | `encode.hexDecode` | Decode a hexadecimal string back to UTF-8 |
43
- | `encode.base32Encode` | Encode a string to Base32 (RFC 4648) |
44
- | `encode.base32Decode` | Decode a Base32-encoded string |
45
- | `encode.urlEncode` | Encode a string using encodeURIComponent |
46
- | `encode.urlDecode` | Decode a URL-encoded string using decodeURIComponent |
47
- | `encode.htmlEncode` | Encode HTML special characters into entities |
48
- | `encode.htmlDecode` | Decode HTML entities back to characters |
49
- | `encode.utf8Encode` | Encode a string to an array of UTF-8 byte values |
50
- | `encode.utf8Decode` | Decode an array of UTF-8 byte values back to a string |
51
- | `encode.binaryEncode` | Encode a string to its binary (0s and 1s) representation |
52
- | `encode.binaryDecode` | Decode a binary (0s and 1s) string back to text |
53
- | `encode.asciiToChar` | Convert an ASCII code to its character |
54
- | `encode.charToAscii` | Convert a character to its ASCII code |
55
- | `encode.rot13` | Apply ROT13 substitution cipher to a string |
56
- | `encode.percentEncode` | Percent-encode every byte of a string (e.g. 'A' becomes '%41') |
57
- | `encode.percentDecode` | Decode a percent-encoded string |
58
-
59
- ## Examples
60
-
61
- ### Decode a Base64-encoded string
62
-
63
- ```robinpath
64
- encode.base64Decode
65
- ```
66
-
67
- ### Encode a string to URL-safe Base64 (no padding, +/ replaced with -_)
68
-
69
- ```robinpath
70
- encode.base64UrlEncode
71
- ```
72
-
73
- ### Decode a URL-safe Base64 string
74
-
75
- ```robinpath
76
- encode.base64UrlDecode
77
- ```
78
-
79
- ## Integration with RobinPath
80
-
81
- ```typescript
82
- import { RobinPath } from "@wiredwp/robinpath";
83
- import Module from "@robinpath/encode";
84
-
85
- const rp = new RobinPath();
86
- rp.registerModule(Module.name, Module.functions);
87
- rp.registerModuleMeta(Module.name, Module.functionMetadata);
88
-
89
- const result = await rp.executeScript(`
90
- encode.base64Decode
91
- `);
92
- ```
93
-
94
- ## Full API Reference
95
-
96
- See [MODULE.md](./MODULE.md) for complete documentation including all parameters, return types, error handling, and advanced examples.
97
-
98
- ## Related Modules
99
-
100
- - [`@robinpath/json`](../json) — JSON module for complementary functionality
101
-
102
- ## License
103
-
104
- MIT
1
+ # @robinpath/encode
2
+
3
+ > Encoding and decoding conversions: Base64, Base32, hex, URL encoding, HTML entities, binary, ROT13, percent-encoding, and more
4
+
5
+ ![Category](https://img.shields.io/badge/category-Utility-blue) ![Functions](https://img.shields.io/badge/functions-21-green) ![Auth](https://img.shields.io/badge/auth-none-lightgrey) ![License](https://img.shields.io/badge/license-MIT-brightgreen)
6
+
7
+ ## Why use this module?
8
+
9
+ The `encode` module lets you:
10
+
11
+ - Encode a string or buffer to Base64
12
+ - Decode a Base64-encoded string
13
+ - Encode a string to URL-safe Base64 (no padding, +/ replaced with -_)
14
+ - Decode a URL-safe Base64 string
15
+ - Encode a string to hexadecimal representation
16
+
17
+ All functions are callable directly from RobinPath scripts with a simple, consistent API.
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ npm install @robinpath/encode
23
+ ```
24
+
25
+ ## Quick Start
26
+
27
+ No credentials needed — start using it right away:
28
+
29
+ ```robinpath
30
+ encode.base64Decode
31
+ ```
32
+
33
+ ## Available Functions
34
+
35
+ | Function | Description |
36
+ |----------|-------------|
37
+ | `encode.base64Encode` | Encode a string or buffer to Base64 |
38
+ | `encode.base64Decode` | Decode a Base64-encoded string |
39
+ | `encode.base64UrlEncode` | Encode a string to URL-safe Base64 (no padding, +/ replaced with -_) |
40
+ | `encode.base64UrlDecode` | Decode a URL-safe Base64 string |
41
+ | `encode.hexEncode` | Encode a string to hexadecimal representation |
42
+ | `encode.hexDecode` | Decode a hexadecimal string back to UTF-8 |
43
+ | `encode.base32Encode` | Encode a string to Base32 (RFC 4648) |
44
+ | `encode.base32Decode` | Decode a Base32-encoded string |
45
+ | `encode.urlEncode` | Encode a string using encodeURIComponent |
46
+ | `encode.urlDecode` | Decode a URL-encoded string using decodeURIComponent |
47
+ | `encode.htmlEncode` | Encode HTML special characters into entities |
48
+ | `encode.htmlDecode` | Decode HTML entities back to characters |
49
+ | `encode.utf8Encode` | Encode a string to an array of UTF-8 byte values |
50
+ | `encode.utf8Decode` | Decode an array of UTF-8 byte values back to a string |
51
+ | `encode.binaryEncode` | Encode a string to its binary (0s and 1s) representation |
52
+ | `encode.binaryDecode` | Decode a binary (0s and 1s) string back to text |
53
+ | `encode.asciiToChar` | Convert an ASCII code to its character |
54
+ | `encode.charToAscii` | Convert a character to its ASCII code |
55
+ | `encode.rot13` | Apply ROT13 substitution cipher to a string |
56
+ | `encode.percentEncode` | Percent-encode every byte of a string (e.g. 'A' becomes '%41') |
57
+ | `encode.percentDecode` | Decode a percent-encoded string |
58
+
59
+ ## Examples
60
+
61
+ ### Decode a Base64-encoded string
62
+
63
+ ```robinpath
64
+ encode.base64Decode
65
+ ```
66
+
67
+ ### Encode a string to URL-safe Base64 (no padding, +/ replaced with -_)
68
+
69
+ ```robinpath
70
+ encode.base64UrlEncode
71
+ ```
72
+
73
+ ### Decode a URL-safe Base64 string
74
+
75
+ ```robinpath
76
+ encode.base64UrlDecode
77
+ ```
78
+
79
+ ## Integration with RobinPath
80
+
81
+ ```typescript
82
+ import { RobinPath } from "@wiredwp/robinpath";
83
+ import Module from "@robinpath/encode";
84
+
85
+ const rp = new RobinPath();
86
+ rp.registerModule(Module.name, Module.functions);
87
+ rp.registerModuleMeta(Module.name, Module.functionMetadata);
88
+
89
+ const result = await rp.executeScript(`
90
+ encode.base64Decode
91
+ `);
92
+ ```
93
+
94
+ ## Full API Reference
95
+
96
+ See [MODULE.md](./MODULE.md) for complete documentation including all parameters, return types, error handling, and advanced examples.
97
+
98
+ ## Related Modules
99
+
100
+ - [`@robinpath/json`](../json) — JSON module for complementary functionality
101
+
102
+ ## License
103
+
104
+ MIT
package/package.json CHANGED
@@ -1,13 +1,43 @@
1
1
  {
2
2
  "name": "@robinpath/encode",
3
- "version": "0.1.0",
4
- "publishConfig": { "access": "public" },
3
+ "version": "0.1.1",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
5
7
  "type": "module",
6
8
  "main": "dist/index.js",
7
9
  "types": "dist/index.d.ts",
8
- "exports": { ".": { "import": "./dist/index.js", "types": "./dist/index.d.ts" } },
9
- "files": ["dist"],
10
- "scripts": { "build": "tsc", "test": "node --import tsx --test tests/*.test.ts" },
11
- "peerDependencies": { "@wiredwp/robinpath": ">=0.20.0" },
12
- "devDependencies": { "@wiredwp/robinpath": "^0.30.1", "tsx": "^4.19.0", "typescript": "^5.6.0" }
10
+ "exports": {
11
+ ".": {
12
+ "import": "./dist/index.js",
13
+ "types": "./dist/index.d.ts"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc",
21
+ "test": "node --import tsx --test tests/*.test.ts"
22
+ },
23
+ "peerDependencies": {
24
+ "@robinpath/core": ">=0.20.0"
25
+ },
26
+ "devDependencies": {
27
+ "@robinpath/core": "^0.30.1",
28
+ "tsx": "^4.19.0",
29
+ "typescript": "^5.6.0"
30
+ },
31
+ "description": "Encoding and decoding conversions: Base64, Base32, hex, URL encoding, HTML entities, binary, ROT13, percent-encoding, and more",
32
+ "keywords": [
33
+ "encode",
34
+ "utility"
35
+ ],
36
+ "license": "MIT",
37
+ "robinpath": {
38
+ "category": "utility",
39
+ "type": "utility",
40
+ "auth": "none",
41
+ "functionCount": 21
42
+ }
13
43
  }
package/dist/encode.d.ts DELETED
@@ -1,306 +0,0 @@
1
- import type { Value } from "@wiredwp/robinpath";
2
- declare function base64Encode(args: Value[]): any;
3
- declare function base64Decode(args: Value[]): any;
4
- declare function base64UrlEncode(args: Value[]): any;
5
- declare function base64UrlDecode(args: Value[]): any;
6
- declare function hexEncode(args: Value[]): any;
7
- declare function hexDecode(args: Value[]): any;
8
- declare function base32Encode(args: Value[]): any;
9
- declare function base32Decode(args: Value[]): any;
10
- declare function urlEncode(args: Value[]): any;
11
- declare function urlDecode(args: Value[]): any;
12
- declare function htmlEncode(args: Value[]): any;
13
- declare function htmlDecode(args: Value[]): any;
14
- declare function utf8Encode(args: Value[]): any;
15
- declare function utf8Decode(args: Value[]): any;
16
- declare function binaryEncode(args: Value[]): any;
17
- declare function binaryDecode(args: Value[]): any;
18
- declare function asciiToChar(args: Value[]): any;
19
- declare function charToAscii(args: Value[]): any;
20
- declare function rot13(args: Value[]): any;
21
- declare function percentEncode(args: Value[]): any;
22
- declare function percentDecode(args: Value[]): any;
23
- export declare const EncodeFunctions: {
24
- base64Encode: typeof base64Encode;
25
- base64Decode: typeof base64Decode;
26
- base64UrlEncode: typeof base64UrlEncode;
27
- base64UrlDecode: typeof base64UrlDecode;
28
- hexEncode: typeof hexEncode;
29
- hexDecode: typeof hexDecode;
30
- base32Encode: typeof base32Encode;
31
- base32Decode: typeof base32Decode;
32
- urlEncode: typeof urlEncode;
33
- urlDecode: typeof urlDecode;
34
- htmlEncode: typeof htmlEncode;
35
- htmlDecode: typeof htmlDecode;
36
- utf8Encode: typeof utf8Encode;
37
- utf8Decode: typeof utf8Decode;
38
- binaryEncode: typeof binaryEncode;
39
- binaryDecode: typeof binaryDecode;
40
- asciiToChar: typeof asciiToChar;
41
- charToAscii: typeof charToAscii;
42
- rot13: typeof rot13;
43
- percentEncode: typeof percentEncode;
44
- percentDecode: typeof percentDecode;
45
- };
46
- export declare const EncodeFunctionMetadata: {
47
- base64Encode: {
48
- description: string;
49
- parameters: {
50
- name: string;
51
- dataType: string;
52
- formInputType: string;
53
- required: boolean;
54
- description: string;
55
- }[];
56
- returnType: string;
57
- returnDescription: string;
58
- };
59
- base64Decode: {
60
- description: string;
61
- parameters: {
62
- name: string;
63
- dataType: string;
64
- formInputType: string;
65
- required: boolean;
66
- description: string;
67
- }[];
68
- returnType: string;
69
- returnDescription: string;
70
- };
71
- base64UrlEncode: {
72
- description: string;
73
- parameters: {
74
- name: string;
75
- dataType: string;
76
- formInputType: string;
77
- required: boolean;
78
- description: string;
79
- }[];
80
- returnType: string;
81
- returnDescription: string;
82
- };
83
- base64UrlDecode: {
84
- description: string;
85
- parameters: {
86
- name: string;
87
- dataType: string;
88
- formInputType: string;
89
- required: boolean;
90
- description: string;
91
- }[];
92
- returnType: string;
93
- returnDescription: string;
94
- };
95
- hexEncode: {
96
- description: string;
97
- parameters: {
98
- name: string;
99
- dataType: string;
100
- formInputType: string;
101
- required: boolean;
102
- description: string;
103
- }[];
104
- returnType: string;
105
- returnDescription: string;
106
- };
107
- hexDecode: {
108
- description: string;
109
- parameters: {
110
- name: string;
111
- dataType: string;
112
- formInputType: string;
113
- required: boolean;
114
- description: string;
115
- }[];
116
- returnType: string;
117
- returnDescription: string;
118
- };
119
- base32Encode: {
120
- description: string;
121
- parameters: {
122
- name: string;
123
- dataType: string;
124
- formInputType: string;
125
- required: boolean;
126
- description: string;
127
- }[];
128
- returnType: string;
129
- returnDescription: string;
130
- };
131
- base32Decode: {
132
- description: string;
133
- parameters: {
134
- name: string;
135
- dataType: string;
136
- formInputType: string;
137
- required: boolean;
138
- description: string;
139
- }[];
140
- returnType: string;
141
- returnDescription: string;
142
- };
143
- urlEncode: {
144
- description: string;
145
- parameters: {
146
- name: string;
147
- dataType: string;
148
- formInputType: string;
149
- required: boolean;
150
- description: string;
151
- }[];
152
- returnType: string;
153
- returnDescription: string;
154
- };
155
- urlDecode: {
156
- description: string;
157
- parameters: {
158
- name: string;
159
- dataType: string;
160
- formInputType: string;
161
- required: boolean;
162
- description: string;
163
- }[];
164
- returnType: string;
165
- returnDescription: string;
166
- };
167
- htmlEncode: {
168
- description: string;
169
- parameters: {
170
- name: string;
171
- dataType: string;
172
- formInputType: string;
173
- required: boolean;
174
- description: string;
175
- }[];
176
- returnType: string;
177
- returnDescription: string;
178
- };
179
- htmlDecode: {
180
- description: string;
181
- parameters: {
182
- name: string;
183
- dataType: string;
184
- formInputType: string;
185
- required: boolean;
186
- description: string;
187
- }[];
188
- returnType: string;
189
- returnDescription: string;
190
- };
191
- utf8Encode: {
192
- description: string;
193
- parameters: {
194
- name: string;
195
- dataType: string;
196
- formInputType: string;
197
- required: boolean;
198
- description: string;
199
- }[];
200
- returnType: string;
201
- returnDescription: string;
202
- };
203
- utf8Decode: {
204
- description: string;
205
- parameters: {
206
- name: string;
207
- dataType: string;
208
- formInputType: string;
209
- required: boolean;
210
- description: string;
211
- }[];
212
- returnType: string;
213
- returnDescription: string;
214
- };
215
- binaryEncode: {
216
- description: string;
217
- parameters: {
218
- name: string;
219
- dataType: string;
220
- formInputType: string;
221
- required: boolean;
222
- description: string;
223
- }[];
224
- returnType: string;
225
- returnDescription: string;
226
- };
227
- binaryDecode: {
228
- description: string;
229
- parameters: {
230
- name: string;
231
- dataType: string;
232
- formInputType: string;
233
- required: boolean;
234
- description: string;
235
- }[];
236
- returnType: string;
237
- returnDescription: string;
238
- };
239
- asciiToChar: {
240
- description: string;
241
- parameters: {
242
- name: string;
243
- dataType: string;
244
- formInputType: string;
245
- required: boolean;
246
- description: string;
247
- }[];
248
- returnType: string;
249
- returnDescription: string;
250
- };
251
- charToAscii: {
252
- description: string;
253
- parameters: {
254
- name: string;
255
- dataType: string;
256
- formInputType: string;
257
- required: boolean;
258
- description: string;
259
- }[];
260
- returnType: string;
261
- returnDescription: string;
262
- };
263
- rot13: {
264
- description: string;
265
- parameters: {
266
- name: string;
267
- dataType: string;
268
- formInputType: string;
269
- required: boolean;
270
- description: string;
271
- }[];
272
- returnType: string;
273
- returnDescription: string;
274
- };
275
- percentEncode: {
276
- description: string;
277
- parameters: {
278
- name: string;
279
- dataType: string;
280
- formInputType: string;
281
- required: boolean;
282
- description: string;
283
- }[];
284
- returnType: string;
285
- returnDescription: string;
286
- };
287
- percentDecode: {
288
- description: string;
289
- parameters: {
290
- name: string;
291
- dataType: string;
292
- formInputType: string;
293
- required: boolean;
294
- description: string;
295
- }[];
296
- returnType: string;
297
- returnDescription: string;
298
- };
299
- };
300
- export declare const EncodeModuleMetadata: {
301
- description: string;
302
- version: string;
303
- tags: string[];
304
- };
305
- export {};
306
- //# sourceMappingURL=encode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../src/encode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoD,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAsClG,iBAAS,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,GAAG,CAGxC;AAED,iBAAS,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,GAAG,CAGxC;AAED,iBAAS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AE,KAAK,EAAE,GAAG,GAAG,CAkBzC;AAID,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;CAsB3B,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+LlC,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;CAIhC,CAAC"}
package/dist/encode.js DELETED
@@ -1,381 +0,0 @@
1
- import { Buffer } from "node:buffer";
2
- // ── Helpers ──────────────────────────────────────────────────────────────────
3
- const BASE32_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
4
- function toString(v) {
5
- if (typeof v === "string")
6
- return v;
7
- if (v === null || v === undefined)
8
- return "";
9
- if (Buffer.isBuffer(v))
10
- return v.toString("utf8");
11
- return String(v);
12
- }
13
- function toBuffer(v) {
14
- if (Buffer.isBuffer(v))
15
- return v;
16
- return Buffer.from(toString(v), "utf8");
17
- }
18
- const HTML_ENTITY_MAP = {
19
- "&": "&",
20
- "<": "&lt;",
21
- ">": "&gt;",
22
- '"': "&quot;",
23
- "'": "&#39;",
24
- };
25
- const HTML_DECODE_MAP = {
26
- "&amp;": "&",
27
- "&lt;": "<",
28
- "&gt;": ">",
29
- "&quot;": '"',
30
- "&#39;": "'",
31
- "&#x27;": "'",
32
- };
33
- // ── Functions ────────────────────────────────────────────────────────────────
34
- function base64Encode(args) {
35
- const buf = toBuffer(args[0]);
36
- return buf.toString("base64");
37
- }
38
- function base64Decode(args) {
39
- const input = toString(args[0]);
40
- return Buffer.from(input, "base64").toString("utf8");
41
- }
42
- function base64UrlEncode(args) {
43
- const buf = toBuffer(args[0]);
44
- return buf.toString("base64url");
45
- }
46
- function base64UrlDecode(args) {
47
- const input = toString(args[0]);
48
- return Buffer.from(input, "base64url").toString("utf8");
49
- }
50
- function hexEncode(args) {
51
- const buf = toBuffer(args[0]);
52
- return buf.toString("hex");
53
- }
54
- function hexDecode(args) {
55
- const input = toString(args[0]);
56
- return Buffer.from(input, "hex").toString("utf8");
57
- }
58
- function base32Encode(args) {
59
- const buf = toBuffer(args[0]);
60
- let bits = "";
61
- for (let i = 0; i < buf.length; i++) {
62
- bits += buf[i].toString(2).padStart(8, "0");
63
- }
64
- let result = "";
65
- for (let i = 0; i < bits.length; i += 5) {
66
- const chunk = bits.slice(i, i + 5).padEnd(5, "0");
67
- result += BASE32_ALPHABET[parseInt(chunk, 2)];
68
- }
69
- const padLen = [0, 6, 4, 3, 1][buf.length % 5];
70
- result += "=".repeat(padLen);
71
- return result;
72
- }
73
- function base32Decode(args) {
74
- const input = toString(args[0]).replace(/=+$/, "").toUpperCase();
75
- let bits = "";
76
- for (const ch of input) {
77
- const idx = BASE32_ALPHABET.indexOf(ch);
78
- if (idx === -1)
79
- continue;
80
- bits += idx.toString(2).padStart(5, "0");
81
- }
82
- const bytes = [];
83
- for (let i = 0; i + 8 <= bits.length; i += 8) {
84
- bytes.push(parseInt(bits.slice(i, i + 8), 2));
85
- }
86
- return Buffer.from(bytes).toString("utf8");
87
- }
88
- function urlEncode(args) {
89
- return encodeURIComponent(toString(args[0]));
90
- }
91
- function urlDecode(args) {
92
- return decodeURIComponent(toString(args[0]));
93
- }
94
- function htmlEncode(args) {
95
- const input = toString(args[0]);
96
- return input.replace(/[&<>"']/g, (ch) => HTML_ENTITY_MAP[ch] ?? ch);
97
- }
98
- function htmlDecode(args) {
99
- const input = toString(args[0]);
100
- return input.replace(/&amp;|&lt;|&gt;|&quot;|&#39;|&#x27;/g, (entity) => HTML_DECODE_MAP[entity] ?? entity);
101
- }
102
- function utf8Encode(args) {
103
- const buf = toBuffer(args[0]);
104
- const result = [];
105
- for (let i = 0; i < buf.length; i++) {
106
- result.push(buf[i]);
107
- }
108
- return result;
109
- }
110
- function utf8Decode(args) {
111
- const input = args[0];
112
- if (Array.isArray(input)) {
113
- return Buffer.from(input).toString("utf8");
114
- }
115
- return toString(input);
116
- }
117
- function binaryEncode(args) {
118
- const buf = toBuffer(args[0]);
119
- const separator = toString(args[1]) || " ";
120
- const result = [];
121
- for (let i = 0; i < buf.length; i++) {
122
- result.push(buf[i].toString(2).padStart(8, "0"));
123
- }
124
- return result.join(separator);
125
- }
126
- function binaryDecode(args) {
127
- const input = toString(args[0]).replace(/[^01]/g, "");
128
- const bytes = [];
129
- for (let i = 0; i < input.length; i += 8) {
130
- const chunk = input.slice(i, i + 8);
131
- if (chunk.length === 8) {
132
- bytes.push(parseInt(chunk, 2));
133
- }
134
- }
135
- return Buffer.from(bytes).toString("utf8");
136
- }
137
- function asciiToChar(args) {
138
- const code = typeof args[0] === "number" ? args[0] : parseInt(toString(args[0]), 10);
139
- if (isNaN(code) || code < 0 || code > 127)
140
- return "";
141
- return String.fromCharCode(code);
142
- }
143
- function charToAscii(args) {
144
- const input = toString(args[0]);
145
- if (input.length === 0)
146
- return -1;
147
- return input.charCodeAt(0);
148
- }
149
- function rot13(args) {
150
- const input = toString(args[0]);
151
- return input.replace(/[a-zA-Z]/g, (ch) => {
152
- const base = ch <= "Z" ? 65 : 97;
153
- return String.fromCharCode(((ch.charCodeAt(0) - base + 13) % 26) + base);
154
- });
155
- }
156
- function percentEncode(args) {
157
- const input = toString(args[0]);
158
- return Array.from(Buffer.from(input, "utf8"))
159
- .map((byte) => "%" + byte.toString(16).toUpperCase().padStart(2, "0"))
160
- .join("");
161
- }
162
- function percentDecode(args) {
163
- const input = toString(args[0]);
164
- const bytes = [];
165
- let i = 0;
166
- while (i < input.length) {
167
- if (input[i] === "%" && i + 2 < input.length) {
168
- const hex = input.slice(i + 1, i + 3);
169
- const val = parseInt(hex, 16);
170
- if (!isNaN(val)) {
171
- bytes.push(val);
172
- i += 3;
173
- continue;
174
- }
175
- }
176
- bytes.push(input.charCodeAt(i));
177
- i++;
178
- }
179
- return Buffer.from(bytes).toString("utf8");
180
- }
181
- // ── Exports ──────────────────────────────────────────────────────────────────
182
- export const EncodeFunctions = {
183
- base64Encode,
184
- base64Decode,
185
- base64UrlEncode,
186
- base64UrlDecode,
187
- hexEncode,
188
- hexDecode,
189
- base32Encode,
190
- base32Decode,
191
- urlEncode,
192
- urlDecode,
193
- htmlEncode,
194
- htmlDecode,
195
- utf8Encode,
196
- utf8Decode,
197
- binaryEncode,
198
- binaryDecode,
199
- asciiToChar,
200
- charToAscii,
201
- rot13,
202
- percentEncode,
203
- percentDecode,
204
- };
205
- export const EncodeFunctionMetadata = {
206
- base64Encode: {
207
- description: "Encode a string or buffer to Base64",
208
- parameters: [
209
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The data to encode" },
210
- ],
211
- returnType: "object",
212
- returnDescription: "API response.",
213
- },
214
- base64Decode: {
215
- description: "Decode a Base64-encoded string",
216
- parameters: [
217
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The Base64 string to decode" },
218
- ],
219
- returnType: "object",
220
- returnDescription: "API response.",
221
- },
222
- base64UrlEncode: {
223
- description: "Encode a string to URL-safe Base64 (no padding, +/ replaced with -_)",
224
- parameters: [
225
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The data to encode" },
226
- ],
227
- returnType: "object",
228
- returnDescription: "API response.",
229
- },
230
- base64UrlDecode: {
231
- description: "Decode a URL-safe Base64 string",
232
- parameters: [
233
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The URL-safe Base64 string to decode" },
234
- ],
235
- returnType: "object",
236
- returnDescription: "API response.",
237
- },
238
- hexEncode: {
239
- description: "Encode a string to hexadecimal representation",
240
- parameters: [
241
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The data to encode" },
242
- ],
243
- returnType: "object",
244
- returnDescription: "API response.",
245
- },
246
- hexDecode: {
247
- description: "Decode a hexadecimal string back to UTF-8",
248
- parameters: [
249
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The hex string to decode" },
250
- ],
251
- returnType: "object",
252
- returnDescription: "API response.",
253
- },
254
- base32Encode: {
255
- description: "Encode a string to Base32 (RFC 4648)",
256
- parameters: [
257
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The data to encode" },
258
- ],
259
- returnType: "object",
260
- returnDescription: "API response.",
261
- },
262
- base32Decode: {
263
- description: "Decode a Base32-encoded string",
264
- parameters: [
265
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The Base32 string to decode" },
266
- ],
267
- returnType: "object",
268
- returnDescription: "API response.",
269
- },
270
- urlEncode: {
271
- description: "Encode a string using encodeURIComponent",
272
- parameters: [
273
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The string to URL-encode" },
274
- ],
275
- returnType: "object",
276
- returnDescription: "API response.",
277
- },
278
- urlDecode: {
279
- description: "Decode a URL-encoded string using decodeURIComponent",
280
- parameters: [
281
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The URL-encoded string to decode" },
282
- ],
283
- returnType: "object",
284
- returnDescription: "API response.",
285
- },
286
- htmlEncode: {
287
- description: "Encode HTML special characters into entities",
288
- parameters: [
289
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The string to encode" },
290
- ],
291
- returnType: "object",
292
- returnDescription: "API response.",
293
- },
294
- htmlDecode: {
295
- description: "Decode HTML entities back to characters",
296
- parameters: [
297
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The HTML-encoded string to decode" },
298
- ],
299
- returnType: "object",
300
- returnDescription: "API response.",
301
- },
302
- utf8Encode: {
303
- description: "Encode a string to an array of UTF-8 byte values",
304
- parameters: [
305
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The string to encode" },
306
- ],
307
- returnType: "object",
308
- returnDescription: "API response.",
309
- },
310
- utf8Decode: {
311
- description: "Decode an array of UTF-8 byte values back to a string",
312
- parameters: [
313
- { name: "input", dataType: "array", formInputType: "json", required: true, description: "Array of byte values" },
314
- ],
315
- returnType: "object",
316
- returnDescription: "API response.",
317
- },
318
- binaryEncode: {
319
- description: "Encode a string to its binary (0s and 1s) representation",
320
- parameters: [
321
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The string to encode" },
322
- { name: "separator", dataType: "string", formInputType: "text", required: false, description: "Separator between bytes (default: ' ')" },
323
- ],
324
- returnType: "object",
325
- returnDescription: "API response.",
326
- },
327
- binaryDecode: {
328
- description: "Decode a binary (0s and 1s) string back to text",
329
- parameters: [
330
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The binary string to decode" },
331
- ],
332
- returnType: "object",
333
- returnDescription: "API response.",
334
- },
335
- asciiToChar: {
336
- description: "Convert an ASCII code to its character",
337
- parameters: [
338
- { name: "code", dataType: "number", formInputType: "number", required: true, description: "ASCII code (0-127)" },
339
- ],
340
- returnType: "object",
341
- returnDescription: "API response.",
342
- },
343
- charToAscii: {
344
- description: "Convert a character to its ASCII code",
345
- parameters: [
346
- { name: "char", dataType: "string", formInputType: "text", required: true, description: "A single character" },
347
- ],
348
- returnType: "object",
349
- returnDescription: "API response.",
350
- },
351
- rot13: {
352
- description: "Apply ROT13 substitution cipher to a string",
353
- parameters: [
354
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The string to transform" },
355
- ],
356
- returnType: "object",
357
- returnDescription: "API response.",
358
- },
359
- percentEncode: {
360
- description: "Percent-encode every byte of a string (e.g. 'A' becomes '%41')",
361
- parameters: [
362
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The string to encode" },
363
- ],
364
- returnType: "object",
365
- returnDescription: "API response.",
366
- },
367
- percentDecode: {
368
- description: "Decode a percent-encoded string",
369
- parameters: [
370
- { name: "input", dataType: "string", formInputType: "text", required: true, description: "The percent-encoded string to decode" },
371
- ],
372
- returnType: "object",
373
- returnDescription: "API response.",
374
- },
375
- };
376
- export const EncodeModuleMetadata = {
377
- description: "Encoding and decoding conversions: Base64, Base32, hex, URL encoding, HTML entities, binary, ROT13, percent-encoding, and more",
378
- version: "1.0.0",
379
- tags: ["encode", "decode", "base64", "hex", "url", "html", "binary", "conversion"],
380
- };
381
- //# sourceMappingURL=encode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"encode.js","sourceRoot":"","sources":["../src/encode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,gFAAgF;AAEhF,MAAM,eAAe,GAAG,kCAAkC,CAAC;AAE3D,SAAS,QAAQ,CAAC,CAAU;IAC1B,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC;IACpC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IAC7C,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAClD,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC;AAED,SAAS,QAAQ,CAAC,CAAU;IAC1B,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IACjC,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,eAAe,GAA2B;IAC9C,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,OAAO;CACb,CAAC;AAEF,MAAM,eAAe,GAA2B;IAC9C,OAAO,EAAE,GAAG;IACZ,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,GAAG;IACX,QAAQ,EAAE,GAAG;IACb,OAAO,EAAE,GAAG;IACZ,QAAQ,EAAE,GAAG;CACd,CAAC;AAEF,gFAAgF;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,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sBAAsB,EAAE;SAClH;QAED,UAAU,EAAE,QAAQ;QACpB,iBAAiB,EAAE,eAAe;KACnC;IACD,aAAa,EAAE;QACb,WAAW,EAAE,iCAAiC;QAC9C,UAAU,EAAE;YACV,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sCAAsC,EAAE;SAClI;QAED,UAAU,EAAE,QAAQ;QACpB,iBAAiB,EAAE,eAAe;KACnC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EAAE,gIAAgI;IAC7I,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAC;CACnF,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import type { ModuleAdapter } from "@wiredwp/robinpath";
2
- declare const EncodeModule: ModuleAdapter;
3
- export default EncodeModule;
4
- export { EncodeModule };
5
- export { EncodeFunctions, EncodeFunctionMetadata, EncodeModuleMetadata } from "./encode.js";
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,QAAA,MAAM,YAAY,EAAE,aAA2K,CAAC;AAChM,eAAe,YAAY,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js DELETED
@@ -1,6 +0,0 @@
1
- import { EncodeFunctions, EncodeFunctionMetadata, EncodeModuleMetadata } from "./encode.js";
2
- const EncodeModule = { name: "encode", functions: EncodeFunctions, functionMetadata: EncodeFunctionMetadata, moduleMetadata: EncodeModuleMetadata, global: false };
3
- export default EncodeModule;
4
- export { EncodeModule };
5
- export { EncodeFunctions, EncodeFunctionMetadata, EncodeModuleMetadata } from "./encode.js";
6
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC5F,MAAM,YAAY,GAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAE,sBAA6B,EAAE,cAAc,EAAE,oBAA2B,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAChM,eAAe,YAAY,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC"}