-
Notifications
You must be signed in to change notification settings - Fork 292
Expand file tree
/
Copy pathdrpy-test.js
More file actions
29 lines (25 loc) · 1.3 KB
/
drpy-test.js
File metadata and controls
29 lines (25 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import {cheerio, 模板} from '../dist/drpy-core.min.js';
// import {cheerio, JSONPath, TextDecoder, TextEncoder, 模板} from './drpy-core.js';
console.log('typeof 模板:', typeof (模板))
console.log('typeof cheerio:', typeof (cheerio))
// console.log(模板)
console.log('typeof gbkTool:', typeof gbkTool);
console.log('typeof CryptoJS:', typeof CryptoJS);
console.log('typeof JSEncrypt:', typeof JSEncrypt);
console.log('typeof NODERSA:', typeof NODERSA);
console.log('typeof pako:', typeof pako);
console.log('typeof JSON5:', typeof JSON5);
console.log('typeof JSONPath:', typeof JSONPath);
console.log('typeof jinja:', typeof jinja);
console.log('typeof WebAssembly:', typeof WebAssembly);
console.log('typeof TextEncoder:', typeof TextEncoder);
console.log('typeof TextDecoder:', typeof TextDecoder);
console.log('typeof WXXH:', typeof WXXH);
console.log(gbkTool.encode('你好'));
console.log(gbkTool.decode('%C4%E3%BA%C3'));
const s = '{"method":"GET","timestamp":1745206708456,"path":"/index/fuck","parameters":{"timestamp":["1745206708456"]},"body":""}';
const seed = 1745206708;
const hash = WXXH.h64(s, seed).toString(16);
console.log(`WASM:${hash}`);
console.log(cheerio.jinja2('渲染一个变量{{hash}}', {hash}));
console.log('jsonpath取值测试:', cheerio.jp('$.name', {name: '道长', project: 'drpys'}));