luosakura-service commited on
Commit
91f1815
·
verified ·
1 Parent(s): aea9cb7

Upload test.js with huggingface_hub

Browse files
Files changed (1) hide show
  1. test.js +351 -0
test.js ADDED
@@ -0,0 +1,351 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function createO(e = 21) {
2
+ let t = ""
3
+ , n = crypto.getRandomValues(new Uint8Array(e |= 0));
4
+ for (; e--;)
5
+ t += "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63 & n[e]];
6
+ return t
7
+ }
8
+
9
+ // 这里的e需要有url,以及method
10
+ function getData(e, post_body) {
11
+ if ("GET" === e.method) {
12
+ var n, r = e.url.indexOf("?");
13
+ if (-1 !== r)
14
+ return e.url.substring(r + 1)
15
+ } else if ("POST" === e.method)
16
+ return null !== (n = post_body) && void 0 !== n ? n : "";
17
+ return ""
18
+ }
19
+
20
+ import crypto from 'crypto'
21
+ function md5(text) {
22
+ let d = crypto.createHash('md5')
23
+ d.write(text);
24
+ return d.digest('hex').toString()
25
+ }
26
+
27
+ console.log(md5(`1747566987{"pageIndex":1,"pageSize":5,"sortType":1,"title":"b"}aUswti0LnUAW5UXqDbZfu`).toUpperCase())
28
+
29
+
30
+ // 以下是wasm版加密
31
+
32
+
33
+ let wasmInstanceExports;
34
+ let memory = null;
35
+ function getMemory() {
36
+ return (null === memory || 0 === memory.byteLength) && (memory = new Uint8Array(wasmInstanceExports.memory.buffer)),
37
+ memory
38
+ }
39
+
40
+ function g(e, t, n) {
41
+ // if (void 0 === n) { // 这个可以不看,必然不触发
42
+ // var r = h.encode(e)
43
+ // , o = t(r.length, 1) >>> 0;
44
+ // return f().subarray(o, o + r.length).set(r),
45
+ // p = r.length,
46
+ // o
47
+ // }
48
+ for (var i = e.length, a = t(i, 1) >>> 0, s = getMemory(), c = 0; c < i; c++) {
49
+ var l = e.charCodeAt(c);
50
+ if (l > 127)
51
+ break;
52
+ s[a + c] = l
53
+ }
54
+ // if (c !== i) { // 这个可以不看,必然不触发
55
+ // 0 !== c && (e = e.slice(c)),
56
+ // a = n(a, i, i = c + 3 * e.length, 1) >>> 0;
57
+ // var u = m(e, f().subarray(a + c, a + i));
58
+ // c += u.written,
59
+ // a = n(a, i, c, 1) >>> 0
60
+ // }
61
+ return a
62
+ }
63
+
64
+
65
+ function doSomeThingAndThrowWhenCatchError(e, t) {
66
+ try {
67
+ return e.apply(this, t)
68
+ } catch (e) {
69
+ var n = a(e);
70
+ wasmInstanceExports.__wbindgen_exn_store(n)
71
+ }
72
+ }
73
+
74
+ function a(e) {
75
+ var t = wasmInstanceExports.__externref_table_alloc();
76
+ return wasmInstanceExports.__wbindgen_export_2.set(t, e),
77
+ t
78
+ }
79
+ function isNull(e) {
80
+ return null == e
81
+ }
82
+
83
+
84
+ var l = new TextDecoder("utf-8", {
85
+ ignoreBOM: !0,
86
+ fatal: !0
87
+ })
88
+
89
+ function decodeMemoryContent(e, t) {
90
+ return e >>>= 0,
91
+ l.decode(getMemory().subarray(e, e + t))
92
+ }
93
+ let dataview = null;
94
+ function getdataview() {
95
+ return (null === dataview || !0 === dataview.buffer.detached || void 0 === dataview.buffer.detached && dataview.buffer !== wasmInstanceExports.memory.buffer) && (dataview = new DataView(wasmInstanceExports.memory.buffer)),
96
+ dataview
97
+ }
98
+
99
+ (wasmImports = {}).wbg = {},
100
+ wasmImports.wbg.__wbg_buffer_609cc3eee51ed158 = function (e) {
101
+ return e.buffer
102
+ }
103
+ ,
104
+ wasmImports.wbg.__wbg_call_672a4d21634d4a24 = function () {
105
+ return doSomeThingAndThrowWhenCatchError(function (e, t) {
106
+ return e.call(t)
107
+ }, arguments)
108
+ }
109
+ ,
110
+ wasmImports.wbg.__wbg_call_7cccdd69e0791ae2 = function () {
111
+ return doSomeThingAndThrowWhenCatchError(function (e, t, n) {
112
+ return e.call(t, n)
113
+ }, arguments)
114
+ }
115
+ ,
116
+ wasmImports.wbg.__wbg_crypto_ed58b8e10a292839 = function (e) {
117
+ return e.crypto
118
+ }
119
+ ,
120
+ wasmImports.wbg.__wbg_document_d249400bd7bd996d = function (e) {
121
+ var t = e.document;
122
+ return isNull(t) ? 0 : a(t)
123
+ }
124
+ ,
125
+ wasmImports.wbg.__wbg_getElementById_f827f0d6648718a8 = function (e, t, n) {
126
+ var r = e.getElementById(decodeMemoryContent(t, n));
127
+ return isNull(r) ? 0 : a(r)
128
+ }
129
+ ,
130
+ wasmImports.wbg.__wbg_getRandomValues_bcb4912f16000dc4 = function () {
131
+ return doSomeThingAndThrowWhenCatchError(function (e, t) {
132
+ e.getRandomValues(t)
133
+ }, arguments)
134
+ }
135
+ ,
136
+ wasmImports.wbg.__wbg_getTime_46267b1c24877e30 = function (e) {
137
+ return e.getTime()
138
+ }
139
+ ,
140
+ wasmImports.wbg.__wbg_instanceof_Window_def73ea0955fc569 = function (e) {
141
+ var t;
142
+ try {
143
+ t = e instanceof Window
144
+ } catch (e) {
145
+ t = !1
146
+ }
147
+ return t
148
+ }
149
+ ,
150
+ wasmImports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function (e) {
151
+ return e.msCrypto
152
+ }
153
+ ,
154
+ wasmImports.wbg.__wbg_new0_f788a2397c7ca929 = function () {
155
+ return new Date
156
+ }
157
+ ,
158
+ wasmImports.wbg.__wbg_new_405e22f390576ce2 = function () {
159
+ return {}
160
+ }
161
+ ,
162
+ wasmImports.wbg.__wbg_new_5e0be73521bc8c17 = function () {
163
+ return new Map
164
+ }
165
+ ,
166
+ wasmImports.wbg.__wbg_new_78feb108b6472713 = function () {
167
+ return []
168
+ }
169
+ ,
170
+ wasmImports.wbg.__wbg_new_a12002a7f91c75be = function (e) {
171
+ return new Uint8Array(e)
172
+ }
173
+ ,
174
+ wasmImports.wbg.__wbg_newnoargs_105ed471475aaf50 = function (e, t) {
175
+ return Function(decodeMemoryContent(e, t))
176
+ }
177
+ ,
178
+ wasmImports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function (e, t, n) {
179
+ return new Uint8Array(e, t >>> 0, n >>> 0)
180
+ }
181
+ ,
182
+ wasmImports.wbg.__wbg_newwithlength_a381634e90c276d4 = function (e) {
183
+ return new Uint8Array(e >>> 0)
184
+ }
185
+ ,
186
+ wasmImports.wbg.__wbg_node_02999533c4ea02e3 = function (e) {
187
+ return e.node
188
+ }
189
+ ,
190
+ wasmImports.wbg.__wbg_process_5c1d670bc53614b8 = function (e) {
191
+ return e.process
192
+ }
193
+ ,
194
+ wasmImports.wbg.__wbg_randomFillSync_ab2cfe79ebbf2740 = function () {
195
+ return doSomeThingAndThrowWhenCatchError(function (e, t) {
196
+ e.randomFillSync(t)
197
+ }, arguments)
198
+ }
199
+ ,
200
+ wasmImports.wbg.__wbg_require_79b1e9274cde3c87 = function () {
201
+ return doSomeThingAndThrowWhenCatchError(function () {
202
+ return e.require
203
+ }, arguments)
204
+ }
205
+ ,
206
+ wasmImports.wbg.__wbg_set_37837023f3d740e8 = function (e, t, n) {
207
+ e[t >>> 0] = n
208
+ }
209
+ ,
210
+ wasmImports.wbg.__wbg_set_3f1d0b984ed272ed = function (e, t, n) {
211
+ e[t] = n
212
+ }
213
+ ,
214
+ wasmImports.wbg.__wbg_set_65595bdd868b3009 = function (e, t, n) {
215
+ e.set(t, n >>> 0)
216
+ }
217
+ ,
218
+ wasmImports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function (e, t, n) {
219
+ return e.set(t, n)
220
+ }
221
+ ,
222
+ wasmImports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function () { // 获取window对象
223
+ var e = void 0 === n.g ? null : n.g;
224
+ return isNull(e) ? 0 : a(e)
225
+ }
226
+ ,
227
+ wasmImports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function () { // 同样也是window对象
228
+ var e = "undefined" == typeof globalThis ? null : globalThis;
229
+ return isNull(e) ? 0 : a(e)
230
+ }
231
+ ,
232
+ wasmImports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function () { // 还是window对象
233
+ var e = "undefined" == typeof self ? null : self;
234
+ return isNull(e) ? 0 : a(e)
235
+ }
236
+ ,
237
+ wasmImports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function () { // 还是window
238
+ var e = window;
239
+ return isNull(e) ? 0 : a(e)
240
+ }
241
+ ,
242
+ wasmImports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function (e, t, n) {
243
+ return e.subarray(t >>> 0, n >>> 0)
244
+ }
245
+ ,
246
+ wasmImports.wbg.__wbg_versions_c71aa1626a93e0a1 = function (e) {
247
+ return e.versions
248
+ }
249
+ ,
250
+ wasmImports.wbg.__wbindgen_bigint_from_i64 = function (e) {
251
+ return e
252
+ }
253
+ ,
254
+ wasmImports.wbg.__wbindgen_bigint_from_u64 = function (e) {
255
+ return BigInt.asUintN(64, e)
256
+ }
257
+ ,
258
+ wasmImports.wbg.__wbindgen_debug_string = function (e, t) {
259
+ var n = g(function e(t) {
260
+ var n, r = typeof t;
261
+ if ("number" == r || "boolean" == r || null == t)
262
+ return "".concat(t);
263
+ if ("string" == r)
264
+ return '"'.concat(t, '"');
265
+ if ("symbol" == r) {
266
+ var o = t.description;
267
+ return null == o ? "Symbol" : "Symbol(".concat(o, ")")
268
+ }
269
+ if ("function" == r) {
270
+ var i = t.name;
271
+ return "string" == typeof i && i.length > 0 ? "Function(".concat(i, ")") : "Function"
272
+ }
273
+ if (Array.isArray(t)) {
274
+ var a = t.length
275
+ , s = "[";
276
+ a > 0 && (s += e(t[0]));
277
+ for (var c = 1; c < a; c++)
278
+ s += ", " + e(t[c]);
279
+ return s + "]"
280
+ }
281
+ var l = /\[object ([^\]]+)\]/.exec(toString.call(t));
282
+ if (!l || !(l.length > 1))
283
+ return toString.call(t);
284
+ if ("Object" == (n = l[1]))
285
+ try {
286
+ return "Object(" + JSON.stringify(t) + ")"
287
+ } catch (e) {
288
+ return "Object"
289
+ }
290
+ return t instanceof Error ? "".concat(t.name, ": ").concat(t.message, "\n").concat(t.stack) : n
291
+ }(t), wasmInstanceExports.__wbindgen_malloc, wasmInstanceExports.__wbindgen_realloc)
292
+ , o = p;
293
+ getdataview().setInt32(e + 4, o, !0),
294
+ getdataview().setInt32(e + 0, n, !0)
295
+ }
296
+ ,
297
+ wasmImports.wbg.__wbindgen_error_new = function (e, t) {
298
+ return Error(decodeMemoryContent(e, t))
299
+ }
300
+ ,
301
+ wasmImports.wbg.__wbindgen_init_externref_table = function () {
302
+ var e = wasmInstanceExports.__wbindgen_export_2
303
+ , t = e.grow(4);
304
+ e.set(0, void 0),
305
+ e.set(t + 0, void 0),
306
+ e.set(t + 1, null),
307
+ e.set(t + 2, !0),
308
+ e.set(t + 3, !1)
309
+ }
310
+ ,
311
+ wasmImports.wbg.__wbindgen_is_function = function (e) {
312
+ return "function" == typeof e
313
+ }
314
+ ,
315
+ wasmImports.wbg.__wbindgen_is_object = function (e) {
316
+ return "object" == typeof e && null !== e
317
+ }
318
+ ,
319
+ wasmImports.wbg.__wbindgen_is_string = function (e) {
320
+ return "string" == typeof e
321
+ }
322
+ ,
323
+ wasmImports.wbg.__wbindgen_is_undefined = function (e) {
324
+ return void 0 === e
325
+ }
326
+ ,
327
+ wasmImports.wbg.__wbindgen_memory = function () {
328
+ return wasmInstanceExports.memory
329
+ }
330
+ ,
331
+ wasmImports.wbg.__wbindgen_number_new = function (e) {
332
+ return e
333
+ }
334
+ ,
335
+ wasmImports.wbg.__wbindgen_string_new = function (e, t) {
336
+ return decodeMemoryContent(e, t)
337
+ }
338
+ ,
339
+ wasmImports.wbg.__wbindgen_throw = function (e, t) {
340
+ throw Error(decodeMemoryContent(e, t))
341
+ };
342
+
343
+
344
+
345
+ function getSign(bodyJson, UrlPathname) {
346
+ var n = g(bodyJson, wasmInstanceExports.__wbindgen_malloc, wasmInstanceExports.__wbindgen_realloc)
347
+ , o = bodyJson.length
348
+ , i = g(UrlPathname, wasmInstanceExports.__wbindgen_malloc, wasmInstanceExports.__wbindgen_realloc)
349
+ , a = UrlPathname.length;
350
+ return wasmInstanceExports.get_sign(n, o, i, a)
351
+ }