melperjs 6.0.0 → 6.1.0

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/mjs/node.js CHANGED
@@ -1,176 +1,133 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import crypto from "crypto";
4
- import { networkInterfaces } from "os";
5
- import { execSync } from "child_process";
6
- import bcrypt from "bcrypt";
7
- import axios from "axios";
8
- import { HttpsProxyAgent } from "hpagent";
9
- import { CONSTANTS, randomWeighted, sleep } from "./index.js";
10
- export function tokenString(length, useNumbers = true, useUppercase = false) {
11
- const lowercaseChars = CONSTANTS.LOWER_CASE;
12
- const uppercaseChars = CONSTANTS.UPPER_CASE;
13
- const numbers = CONSTANTS.NUMBERS;
14
- let characters = lowercaseChars;
15
- if (useUppercase) characters += uppercaseChars;
16
- if (useNumbers) characters += numbers;
17
- let randomString = '';
18
- while (randomString.length < length) {
19
- const byte = crypto.randomBytes(1)[0];
20
- const index = byte % characters.length;
21
- if (byte < 256 - 256 % characters.length) {
22
- randomString += characters[index];
23
- }
24
- }
25
- return randomString;
26
- }
27
- export function tokenHex(length) {
28
- return crypto.randomBytes(Math.ceil(length / 2)).toString('hex').slice(0, length);
29
- }
30
- export function tokenUuid(useDashes = true) {
31
- const uuid = crypto.randomUUID().toString();
32
- return useDashes ? uuid : uuid.replaceAll("-", "");
33
- }
34
- export function tokenWeighted(dict) {
35
- return randomWeighted(dict, crypto.randomInt);
36
- }
37
- export function serverIp() {
38
- const interfaces = networkInterfaces();
39
- for (const devName in interfaces) {
40
- const interfaceValue = interfaces[devName];
41
- for (let i = 0; i < interfaceValue.length; i++) {
42
- const alias = interfaceValue[i];
43
- if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.address.startsWith("192.168.") && !alias.internal) return alias.address;
44
- }
45
- }
46
- return '127.0.0.1';
47
- }
48
- export function getVersion() {
49
- try {
50
- const date = new Date(execSync('git show -s --format=%ci HEAD').toString().trim());
51
- const formatDatePart = value => value.toString().padStart(2, '0');
52
- const year = date.getFullYear().toString().slice(-2);
53
- const month = formatDatePart(date.getMonth() + 1);
54
- const day = formatDatePart(date.getDate());
55
- const hour = formatDatePart(date.getHours());
56
- const minute = formatDatePart(date.getMinutes());
57
- return parseFloat(`${year}${month}.${day}${hour}${minute}`);
58
- } catch {
59
- return 1.0;
60
- }
61
- }
62
- export function createNumDir(mainDirectory) {
63
- fs.mkdirSync(mainDirectory, {
64
- recursive: true
65
- });
66
- for (let i = 0; i <= 9; i++) {
67
- try {
68
- fs.mkdirSync(path.join(mainDirectory, i.toString()));
69
- } catch (e) {
70
- console.error(`createNumDir:${i}`, e.message);
71
- }
72
- }
73
- }
74
- export function md5(data) {
75
- return crypto.createHash('md5').update(data).digest("hex");
76
- }
77
- export function hashBcrypt(plainText) {
78
- return bcrypt.hashSync(plainText, bcrypt.genSaltSync(10));
79
- }
80
- export function verifyBcrypt(plainText, hash) {
81
- return bcrypt.compareSync(plainText, hash);
82
- }
83
- export function formatProxy(proxy, protocol = "http") {
84
- proxy = proxy.trim();
85
- const splitByProtocol = proxy.split("://");
86
- if (1 < splitByProtocol.length) protocol = splitByProtocol[0];
87
- proxy = splitByProtocol[splitByProtocol.length - 1];
88
- if (!proxy.includes("@")) {
89
- const proxyParts = proxy.split(":");
90
- if (4 <= proxyParts.length) {
91
- proxy = `${proxyParts[proxyParts.length - 2]}:${proxyParts[proxyParts.length - 1]}@`;
92
- proxyParts.pop();
93
- proxyParts.pop();
94
- proxy += proxyParts.join(":");
95
- }
96
- }
97
- const proxyParts = proxy.split(':');
98
- const proxyEnd = parseInt(proxyParts[proxyParts.length - 1]);
99
- const proxyStart = proxyParts[proxyParts.length - 2];
100
- if (!proxyStart.includes(".")) {
101
- proxyParts.pop();
102
- proxyParts[proxyParts.length - 1] = crypto.randomInt(parseInt(proxyStart), proxyEnd + 1).toString();
103
- }
104
- return protocol + "://" + proxyParts.join(':');
105
- }
106
- export function proxyObject(...args) {
107
- let proxy = formatProxy(...args);
108
- const splitByProtocol = proxy.split('://');
109
- const splitById = splitByProtocol[splitByProtocol.length - 1].split('@');
110
- const splitByConn = splitById[splitById.length - 1].split(':');
111
- proxy = {
112
- protocol: splitByProtocol[0],
113
- host: splitByConn[0],
114
- port: parseInt(splitByConn[1])
115
- };
116
- if (1 < splitById.length) {
117
- const splitByAuth = splitById[0].split(':');
118
- proxy.auth = {
119
- username: splitByAuth[0],
120
- password: splitByAuth[1]
121
- };
122
- }
123
- return proxy;
124
- }
125
- export async function proxify(proxyConfig, callback = formatProxy) {
126
- proxyConfig = proxyConfig || {};
127
- const timeout = 7000;
128
- if (proxyConfig.mode === 1) {
129
- return callback(proxyConfig.proxy);
130
- } else if (proxyConfig.mode === 2) {
131
- const proxy = callback(proxyConfig.proxy);
132
- try {
133
- await axios.get(proxyConfig.resetApi, {
134
- timeout
135
- });
136
- } catch {
137
- return false;
138
- }
139
- await sleep(5);
140
- for (let i = 0; i < 5; i++) {
141
- try {
142
- const res = await axios.get("https://api64.ipify.org", {
143
- timeout,
144
- httpsAgent: new HttpsProxyAgent({
145
- proxy,
146
- timeout: 7000
147
- })
148
- });
149
- if (res.status === 200) return proxy;
150
- } catch {
151
- await sleep(3);
152
- }
153
- }
154
- } else if (proxyConfig.mode === 3) {
155
- try {
156
- const res = await axios.get(proxyConfig.resetApi, {
157
- timeout
158
- });
159
- if (res.status === 200) return callback(proxyConfig.proxy);
160
- } catch {
161
- return false;
162
- }
163
- } else if (proxyConfig.mode === 4) {
164
- return callback(proxyConfig.proxy).replace("{SESSION}", tokenHex(8));
165
- } else if (proxyConfig.mode === 5) {
166
- try {
167
- const lines = proxyConfig.proxy.split("\n");
168
- const line = lines[crypto.randomInt(0, lines.length)];
169
- return callback(line);
170
- } catch {
171
- return false;
172
- }
173
- }
174
- return null;
175
- }
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import crypto from "crypto";
4
+ import { networkInterfaces } from "os";
5
+ import { execSync } from "child_process";
6
+ import bcrypt from "bcrypt";
7
+ import { CONSTANTS, randomWeighted, splitLines } from "./index.js";
8
+ export function tokenString(length, useNumbers = true, useUppercase = false) {
9
+ const lowercaseChars = CONSTANTS.LOWER_CASE;
10
+ const uppercaseChars = CONSTANTS.UPPER_CASE;
11
+ const numbers = CONSTANTS.NUMBERS;
12
+ let characters = lowercaseChars;
13
+ if (useUppercase) characters += uppercaseChars;
14
+ if (useNumbers) characters += numbers;
15
+ let randomString = '';
16
+ while (randomString.length < length) {
17
+ const byte = crypto.randomBytes(1)[0];
18
+ const index = byte % characters.length;
19
+ if (byte < 256 - 256 % characters.length) {
20
+ randomString += characters[index];
21
+ }
22
+ }
23
+ return randomString;
24
+ }
25
+ export function tokenHex(length) {
26
+ return crypto.randomBytes(Math.ceil(length / 2)).toString('hex').slice(0, length);
27
+ }
28
+ export function tokenUuid(useDashes = true) {
29
+ const uuid = crypto.randomUUID().toString();
30
+ return useDashes ? uuid : uuid.replaceAll("-", "");
31
+ }
32
+ export function tokenWeighted(dict) {
33
+ return randomWeighted(dict, crypto.randomInt);
34
+ }
35
+ export function serverIp() {
36
+ const interfaces = networkInterfaces();
37
+ for (const devName in interfaces) {
38
+ const interfaceValue = interfaces[devName];
39
+ for (let i = 0; i < interfaceValue.length; i++) {
40
+ const alias = interfaceValue[i];
41
+ if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.address.startsWith("192.168.") && !alias.internal) return alias.address;
42
+ }
43
+ }
44
+ return '127.0.0.1';
45
+ }
46
+ export function getVersion() {
47
+ try {
48
+ const date = new Date(execSync('git show -s --format=%ci HEAD').toString().trim());
49
+ const formatDatePart = value => value.toString().padStart(2, '0');
50
+ const year = date.getFullYear().toString().slice(-2);
51
+ const month = formatDatePart(date.getMonth() + 1);
52
+ const day = formatDatePart(date.getDate());
53
+ const hour = formatDatePart(date.getHours());
54
+ const minute = formatDatePart(date.getMinutes());
55
+ return parseFloat(`${year}${month}.${day}${hour}${minute}`);
56
+ } catch {
57
+ return 1.0;
58
+ }
59
+ }
60
+ export function createNumDir(mainDirectory) {
61
+ fs.mkdirSync(mainDirectory, {
62
+ recursive: true
63
+ });
64
+ for (let i = 0; i <= 9; i++) {
65
+ try {
66
+ fs.mkdirSync(path.join(mainDirectory, i.toString()));
67
+ } catch (e) {
68
+ console.error(`createNumDir:${i}`, e.message);
69
+ }
70
+ }
71
+ }
72
+ export function md5(data) {
73
+ return crypto.createHash('md5').update(data).digest("hex");
74
+ }
75
+ export function hashBcrypt(plainText) {
76
+ return bcrypt.hashSync(plainText, bcrypt.genSaltSync(10));
77
+ }
78
+ export function verifyBcrypt(plainText, hash) {
79
+ return bcrypt.compareSync(plainText, hash);
80
+ }
81
+ export function formatProxy(proxy, protocol = "http") {
82
+ proxy = proxy.trim();
83
+ const splitByProtocol = proxy.split("://");
84
+ if (1 < splitByProtocol.length) protocol = splitByProtocol[0];
85
+ proxy = splitByProtocol[splitByProtocol.length - 1];
86
+ if (!proxy.includes("@")) {
87
+ const proxyParts = proxy.split(":");
88
+ if (4 <= proxyParts.length) {
89
+ proxy = `${proxyParts[proxyParts.length - 2]}:${proxyParts[proxyParts.length - 1]}@`;
90
+ proxyParts.pop();
91
+ proxyParts.pop();
92
+ proxy += proxyParts.join(":");
93
+ }
94
+ }
95
+ const proxyParts = proxy.split(':');
96
+ const proxyEnd = parseInt(proxyParts[proxyParts.length - 1]);
97
+ const proxyStart = proxyParts[proxyParts.length - 2];
98
+ if (!proxyStart.includes(".")) {
99
+ proxyParts.pop();
100
+ proxyParts[proxyParts.length - 1] = crypto.randomInt(parseInt(proxyStart), proxyEnd + 1).toString();
101
+ }
102
+ return protocol + "://" + proxyParts.join(':');
103
+ }
104
+ export function proxyObject(...args) {
105
+ let proxy = formatProxy(...args);
106
+ const splitByProtocol = proxy.split('://');
107
+ const splitById = splitByProtocol[splitByProtocol.length - 1].split('@');
108
+ const splitByConn = splitById[splitById.length - 1].split(':');
109
+ proxy = {
110
+ protocol: splitByProtocol[0],
111
+ host: splitByConn[0],
112
+ port: parseInt(splitByConn[1])
113
+ };
114
+ if (1 < splitById.length) {
115
+ const splitByAuth = splitById[0].split(':');
116
+ proxy.auth = {
117
+ username: splitByAuth[0],
118
+ password: splitByAuth[1]
119
+ };
120
+ }
121
+ return proxy;
122
+ }
123
+ export function proxyValue(proxies) {
124
+ let proxy;
125
+ proxies = proxies || "";
126
+ proxies = splitLines(proxies);
127
+ if (proxies.length < 1) return null;
128
+ proxy = proxies[crypto.randomInt(0, proxies.length)];
129
+ proxy = formatProxy(proxy);
130
+ proxy = proxy.replace("{SESSION}", tokenHex(8));
131
+ return proxy || null;
132
+ }
176
133
  //# sourceMappingURL=node.js.map
package/mjs/node.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","names":["fs","path","crypto","networkInterfaces","execSync","bcrypt","axios","HttpsProxyAgent","CONSTANTS","randomWeighted","sleep","tokenString","length","useNumbers","useUppercase","lowercaseChars","LOWER_CASE","uppercaseChars","UPPER_CASE","numbers","NUMBERS","characters","randomString","byte","randomBytes","index","tokenHex","Math","ceil","toString","slice","tokenUuid","useDashes","uuid","randomUUID","replaceAll","tokenWeighted","dict","randomInt","serverIp","interfaces","devName","interfaceValue","i","alias","family","address","startsWith","internal","getVersion","date","Date","trim","formatDatePart","value","padStart","year","getFullYear","month","getMonth","day","getDate","hour","getHours","minute","getMinutes","parseFloat","createNumDir","mainDirectory","mkdirSync","recursive","join","e","console","error","message","md5","data","createHash","update","digest","hashBcrypt","plainText","hashSync","genSaltSync","verifyBcrypt","hash","compareSync","formatProxy","proxy","protocol","splitByProtocol","split","includes","proxyParts","pop","proxyEnd","parseInt","proxyStart","proxyObject","args","splitById","splitByConn","host","port","splitByAuth","auth","username","password","proxify","proxyConfig","callback","timeout","mode","get","resetApi","res","httpsAgent","status","replace","lines","line"],"sources":["../src/node.js"],"sourcesContent":["import fs from \"fs\";\r\nimport path from \"path\";\r\nimport crypto from \"crypto\";\r\nimport {networkInterfaces} from \"os\";\r\nimport {execSync} from \"child_process\";\r\n\r\nimport bcrypt from \"bcrypt\";\r\nimport axios from \"axios\";\r\nimport {HttpsProxyAgent} from \"hpagent\";\r\n\r\nimport {CONSTANTS, randomWeighted, sleep} from \"./index.js\";\r\n\r\n\r\nexport function tokenString(length, useNumbers = true, useUppercase = false) {\r\n const lowercaseChars = CONSTANTS.LOWER_CASE;\r\n const uppercaseChars = CONSTANTS.UPPER_CASE;\r\n const numbers = CONSTANTS.NUMBERS;\r\n\r\n let characters = lowercaseChars;\r\n if (useUppercase) characters += uppercaseChars;\r\n if (useNumbers) characters += numbers;\r\n\r\n let randomString = '';\r\n while (randomString.length < length) {\r\n const byte = crypto.randomBytes(1)[0];\r\n const index = byte % characters.length;\r\n if (byte < (256 - (256 % characters.length))) {\r\n randomString += characters[index];\r\n }\r\n }\r\n\r\n return randomString;\r\n}\r\n\r\nexport function tokenHex(length) {\r\n return crypto\r\n .randomBytes(Math.ceil(length / 2))\r\n .toString('hex')\r\n .slice(0, length);\r\n}\r\n\r\nexport function tokenUuid(useDashes = true) {\r\n const uuid = crypto.randomUUID().toString();\r\n return useDashes ? uuid : uuid.replaceAll(\"-\", \"\")\r\n}\r\n\r\nexport function tokenWeighted(dict) {\r\n return randomWeighted(dict, crypto.randomInt);\r\n}\r\n\r\nexport function serverIp() {\r\n const interfaces = networkInterfaces();\r\n for (const devName in interfaces) {\r\n const interfaceValue = interfaces[devName];\r\n for (let i = 0; i < interfaceValue.length; i++) {\r\n const alias = interfaceValue[i];\r\n if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.address.startsWith(\"192.168.\") && !alias.internal)\r\n return alias.address;\r\n }\r\n }\r\n return '127.0.0.1';\r\n}\r\n\r\nexport function getVersion() {\r\n try {\r\n const date = new Date(execSync('git show -s --format=%ci HEAD').toString().trim());\r\n const formatDatePart = (value) => value.toString().padStart(2, '0');\r\n const year = date.getFullYear().toString().slice(-2);\r\n const month = formatDatePart(date.getMonth() + 1);\r\n const day = formatDatePart(date.getDate());\r\n const hour = formatDatePart(date.getHours());\r\n const minute = formatDatePart(date.getMinutes());\r\n return parseFloat(`${year}${month}.${day}${hour}${minute}`);\r\n } catch {\r\n return 1.0;\r\n }\r\n}\r\n\r\nexport function createNumDir(mainDirectory) {\r\n fs.mkdirSync(mainDirectory, {recursive: true});\r\n for (let i = 0; i <= 9; i++) {\r\n try {\r\n fs.mkdirSync(path.join(mainDirectory, i.toString()));\r\n } catch (e) {\r\n console.error(`createNumDir:${i}`, e.message);\r\n }\r\n }\r\n}\r\n\r\nexport function md5(data) {\r\n return crypto.createHash('md5').update(data).digest(\"hex\");\r\n}\r\n\r\nexport function hashBcrypt(plainText) {\r\n return bcrypt.hashSync(plainText, bcrypt.genSaltSync(10));\r\n}\r\n\r\nexport function verifyBcrypt(plainText, hash) {\r\n return bcrypt.compareSync(plainText, hash);\r\n}\r\n\r\nexport function formatProxy(proxy, protocol = \"http\") {\r\n proxy = proxy.trim();\r\n const splitByProtocol = proxy.split(\"://\");\r\n if (1 < splitByProtocol.length)\r\n protocol = splitByProtocol[0];\r\n proxy = splitByProtocol[splitByProtocol.length - 1];\r\n if (!proxy.includes(\"@\")) {\r\n const proxyParts = proxy.split(\":\");\r\n if (4 <= proxyParts.length) {\r\n proxy = `${proxyParts[proxyParts.length - 2]}:${proxyParts[proxyParts.length - 1]}@`;\r\n proxyParts.pop();\r\n proxyParts.pop();\r\n proxy += proxyParts.join(\":\");\r\n }\r\n }\r\n const proxyParts = proxy.split(':');\r\n const proxyEnd = parseInt(proxyParts[proxyParts.length - 1]);\r\n const proxyStart = proxyParts[proxyParts.length - 2];\r\n if (!proxyStart.includes(\".\")) {\r\n proxyParts.pop();\r\n proxyParts[proxyParts.length - 1] = crypto.randomInt(parseInt(proxyStart), proxyEnd + 1).toString();\r\n }\r\n return protocol + \"://\" + proxyParts.join(':');\r\n}\r\n\r\nexport function proxyObject(...args) {\r\n let proxy = formatProxy(...args);\r\n const splitByProtocol = proxy.split('://');\r\n const splitById = splitByProtocol[splitByProtocol.length - 1].split('@');\r\n const splitByConn = splitById[splitById.length - 1].split(':');\r\n proxy = {\r\n protocol: splitByProtocol[0],\r\n host: splitByConn[0],\r\n port: parseInt(splitByConn[1]),\r\n };\r\n if (1 < splitById.length) {\r\n const splitByAuth = splitById[0].split(':');\r\n proxy.auth = {\r\n username: splitByAuth[0],\r\n password: splitByAuth[1]\r\n };\r\n }\r\n return proxy;\r\n}\r\n\r\nexport async function proxify(proxyConfig, callback = formatProxy) {\r\n proxyConfig = proxyConfig || {};\r\n const timeout = 7000;\r\n if (proxyConfig.mode === 1) {\r\n return callback(proxyConfig.proxy);\r\n } else if (proxyConfig.mode === 2) {\r\n const proxy = callback(proxyConfig.proxy);\r\n try {\r\n await axios.get(proxyConfig.resetApi, {timeout});\r\n } catch {\r\n return false;\r\n }\r\n await sleep(5);\r\n for (let i = 0; i < 5; i++) {\r\n try {\r\n const res = await axios.get(\"https://api64.ipify.org\", {\r\n timeout,\r\n httpsAgent: new HttpsProxyAgent({proxy, timeout: 7000})\r\n });\r\n if (res.status === 200)\r\n return proxy;\r\n } catch {\r\n await sleep(3);\r\n }\r\n }\r\n } else if (proxyConfig.mode === 3) {\r\n try {\r\n const res = await axios.get(proxyConfig.resetApi, {timeout});\r\n if (res.status === 200)\r\n return callback(proxyConfig.proxy);\r\n } catch {\r\n return false;\r\n }\r\n } else if (proxyConfig.mode === 4) {\r\n return callback(proxyConfig.proxy).replace(\"{SESSION}\", tokenHex(8));\r\n } else if (proxyConfig.mode === 5) {\r\n try {\r\n const lines = proxyConfig.proxy.split(\"\\n\");\r\n const line = lines[crypto.randomInt(0, lines.length)];\r\n return callback(line);\r\n } catch {\r\n return false;\r\n }\r\n }\r\n\r\n return null;\r\n}"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AACnB,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,MAAM,MAAM,QAAQ;AAC3B,SAAQC,iBAAiB,QAAO,IAAI;AACpC,SAAQC,QAAQ,QAAO,eAAe;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AOP,QAAQ,CAACD,WAAW,CAACrB,KAAK,CAAC;IAC1C,CAAC,CAAC,MAAM;MACJ,OAAO,KAAK;IAChB;EACJ,CAAC,MAAM,IAAIqB,WAAW,CAACG,IAAI,KAAK,CAAC,EAAE;IAC/B,OAAOF,QAAQ,CAACD,WAAW,CAACrB,KAAK,CAAC,CAAC8B,OAAO,CAAC,WAAW,EAAE7F,QAAQ,CAAC,CAAC,CAAC,CAAC;EACxE,CAAC,MAAM,IAAIoF,WAAW,CAACG,IAAI,KAAK,CAAC,EAAE;IAC/B,IAAI;MACA,MAAMO,KAAK,GAAGV,WAAW,CAACrB,KAAK,CAACG,KAAK,CAAC,IAAI,CAAC;MAC3C,MAAM6B,IAAI,GAAGD,KAAK,CAACtH,MAAM,CAACoC,SAAS,CAAC,CAAC,EAAEkF,KAAK,CAAC5G,MAAM,CAAC,CAAC;MACrD,OAAOmG,QAAQ,CAACU,IAAI,CAAC;IACzB,CAAC,CAAC,MAAM;MACJ,OAAO,KAAK;IAChB;EACJ;EAEA,OAAO,IAAI;AACf"}
1
+ {"version":3,"file":"node.js","names":["fs","path","crypto","networkInterfaces","execSync","bcrypt","CONSTANTS","randomWeighted","splitLines","tokenString","length","useNumbers","useUppercase","lowercaseChars","LOWER_CASE","uppercaseChars","UPPER_CASE","numbers","NUMBERS","characters","randomString","byte","randomBytes","index","tokenHex","Math","ceil","toString","slice","tokenUuid","useDashes","uuid","randomUUID","replaceAll","tokenWeighted","dict","randomInt","serverIp","interfaces","devName","interfaceValue","i","alias","family","address","startsWith","internal","getVersion","date","Date","trim","formatDatePart","value","padStart","year","getFullYear","month","getMonth","day","getDate","hour","getHours","minute","getMinutes","parseFloat","createNumDir","mainDirectory","mkdirSync","recursive","join","e","console","error","message","md5","data","createHash","update","digest","hashBcrypt","plainText","hashSync","genSaltSync","verifyBcrypt","hash","compareSync","formatProxy","proxy","protocol","splitByProtocol","split","includes","proxyParts","pop","proxyEnd","parseInt","proxyStart","proxyObject","args","splitById","splitByConn","host","port","splitByAuth","auth","username","password","proxyValue","proxies","replace"],"sources":["../src/node.js"],"sourcesContent":["import fs from \"fs\";\r\nimport path from \"path\";\r\nimport crypto from \"crypto\";\r\nimport {networkInterfaces} from \"os\";\r\nimport {execSync} from \"child_process\";\r\n\r\nimport bcrypt from \"bcrypt\";\r\n\r\nimport {CONSTANTS, randomWeighted, splitLines} from \"./index.js\";\r\n\r\n\r\nexport function tokenString(length, useNumbers = true, useUppercase = false) {\r\n const lowercaseChars = CONSTANTS.LOWER_CASE;\r\n const uppercaseChars = CONSTANTS.UPPER_CASE;\r\n const numbers = CONSTANTS.NUMBERS;\r\n\r\n let characters = lowercaseChars;\r\n if (useUppercase) characters += uppercaseChars;\r\n if (useNumbers) characters += numbers;\r\n\r\n let randomString = '';\r\n while (randomString.length < length) {\r\n const byte = crypto.randomBytes(1)[0];\r\n const index = byte % characters.length;\r\n if (byte < (256 - (256 % characters.length))) {\r\n randomString += characters[index];\r\n }\r\n }\r\n\r\n return randomString;\r\n}\r\n\r\nexport function tokenHex(length) {\r\n return crypto\r\n .randomBytes(Math.ceil(length / 2))\r\n .toString('hex')\r\n .slice(0, length);\r\n}\r\n\r\nexport function tokenUuid(useDashes = true) {\r\n const uuid = crypto.randomUUID().toString();\r\n return useDashes ? uuid : uuid.replaceAll(\"-\", \"\")\r\n}\r\n\r\nexport function tokenWeighted(dict) {\r\n return randomWeighted(dict, crypto.randomInt);\r\n}\r\n\r\nexport function serverIp() {\r\n const interfaces = networkInterfaces();\r\n for (const devName in interfaces) {\r\n const interfaceValue = interfaces[devName];\r\n for (let i = 0; i < interfaceValue.length; i++) {\r\n const alias = interfaceValue[i];\r\n if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.address.startsWith(\"192.168.\") && !alias.internal)\r\n return alias.address;\r\n }\r\n }\r\n return '127.0.0.1';\r\n}\r\n\r\nexport function getVersion() {\r\n try {\r\n const date = new Date(execSync('git show -s --format=%ci HEAD').toString().trim());\r\n const formatDatePart = (value) => value.toString().padStart(2, '0');\r\n const year = date.getFullYear().toString().slice(-2);\r\n const month = formatDatePart(date.getMonth() + 1);\r\n const day = formatDatePart(date.getDate());\r\n const hour = formatDatePart(date.getHours());\r\n const minute = formatDatePart(date.getMinutes());\r\n return parseFloat(`${year}${month}.${day}${hour}${minute}`);\r\n } catch {\r\n return 1.0;\r\n }\r\n}\r\n\r\nexport function createNumDir(mainDirectory) {\r\n fs.mkdirSync(mainDirectory, {recursive: true});\r\n for (let i = 0; i <= 9; i++) {\r\n try {\r\n fs.mkdirSync(path.join(mainDirectory, i.toString()));\r\n } catch (e) {\r\n console.error(`createNumDir:${i}`, e.message);\r\n }\r\n }\r\n}\r\n\r\nexport function md5(data) {\r\n return crypto.createHash('md5').update(data).digest(\"hex\");\r\n}\r\n\r\nexport function hashBcrypt(plainText) {\r\n return bcrypt.hashSync(plainText, bcrypt.genSaltSync(10));\r\n}\r\n\r\nexport function verifyBcrypt(plainText, hash) {\r\n return bcrypt.compareSync(plainText, hash);\r\n}\r\n\r\nexport function formatProxy(proxy, protocol = \"http\") {\r\n proxy = proxy.trim();\r\n const splitByProtocol = proxy.split(\"://\");\r\n if (1 < splitByProtocol.length)\r\n protocol = splitByProtocol[0];\r\n proxy = splitByProtocol[splitByProtocol.length - 1];\r\n if (!proxy.includes(\"@\")) {\r\n const proxyParts = proxy.split(\":\");\r\n if (4 <= proxyParts.length) {\r\n proxy = `${proxyParts[proxyParts.length - 2]}:${proxyParts[proxyParts.length - 1]}@`;\r\n proxyParts.pop();\r\n proxyParts.pop();\r\n proxy += proxyParts.join(\":\");\r\n }\r\n }\r\n const proxyParts = proxy.split(':');\r\n const proxyEnd = parseInt(proxyParts[proxyParts.length - 1]);\r\n const proxyStart = proxyParts[proxyParts.length - 2];\r\n if (!proxyStart.includes(\".\")) {\r\n proxyParts.pop();\r\n proxyParts[proxyParts.length - 1] = crypto.randomInt(parseInt(proxyStart), proxyEnd + 1).toString();\r\n }\r\n return protocol + \"://\" + proxyParts.join(':');\r\n}\r\n\r\nexport function proxyObject(...args) {\r\n let proxy = formatProxy(...args);\r\n const splitByProtocol = proxy.split('://');\r\n const splitById = splitByProtocol[splitByProtocol.length - 1].split('@');\r\n const splitByConn = splitById[splitById.length - 1].split(':');\r\n proxy = {\r\n protocol: splitByProtocol[0],\r\n host: splitByConn[0],\r\n port: parseInt(splitByConn[1]),\r\n };\r\n if (1 < splitById.length) {\r\n const splitByAuth = splitById[0].split(':');\r\n proxy.auth = {\r\n username: splitByAuth[0],\r\n password: splitByAuth[1]\r\n };\r\n }\r\n return proxy;\r\n}\r\n\r\nexport function proxyValue(proxies) {\r\n let proxy;\r\n proxies = proxies || \"\";\r\n proxies = splitLines(proxies);\r\n if (proxies.length < 1)\r\n return null;\r\n proxy = proxies[crypto.randomInt(0, proxies.length)];\r\n proxy = formatProxy(proxy);\r\n proxy = proxy.replace(\"{SESSION}\", tokenHex(8));\r\n return proxy || null;\r\n}"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AACnB,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,MAAM,MAAM,QAAQ;AAC3B,SAAQC,iBAAiB,QAAO,IAAI;AACpC,SAAQC,QAAQ,QAAO,eAAe;AAEtC,OAAOC,MAAM,MAAM,QAAQ;AAE3B,SAAQC,SAAS,EAAEC,cAAc,EAAEC,UAAU,QAAO,YAAY;AAGhE,OAAO,SAASC,WAAWA,CAACC,MAAM,EAAEC,UAAU,GAAG,IAAI,EAAEC,YAAY,GAAG,KAAK,EAAE;EACzE,MAAMC,cAAc,GAAGP,SAAS,CAACQ,UAAU;EAC3C,MAAMC,cAAc,GAAGT,SAAS,CAACU,UAAU;EAC3C,MAAMC,OAAO,GAAGX,SAAS,CAACY,OAAO;EAEjC,IAAIC,UAAU,GAAGN,cAAc;EAC/B,IAAID,YAAY,EAAEO,UAAU,IAAIJ,cAAc;EAC9C,IAAIJ,UAAU,EAAEQ,UAAU,IAAIF,OAAO;EAErC,IAAIG,YAAY,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
2
  "name": "melperjs",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "Javascript module to use predefined common functions and utilities",
5
5
  "keywords": [
6
6
  "helper",