某度翻译
# js分析
请求网站,查看所需要的数据,找到所对应的url
请求参数里需要sign
和token
这个token
试过了不需要动,只需解决sign
即可
sign是根据输入的内容生成的
复制请求的url:https://fanyi.baidu.com/v2transapi
先打个断点
点击翻译,断住了,可以看到数据里有所需要的sign
我们需要找到 ajax
请求,看看里面的数据
在 调用堆栈
里依次点击,找到需要的数据,发现在第三个堆栈里
data: w,
w就是请求的数据,
可以控制台输出一下,里面有所需要的sign
值
和之前请求翻译“你好”的sign一样,说明值是根据输入内容生成的
根据w
的内容,可以知道sign
是由 b(e)
生成的
w = {
from: v.fromLang,
to: v.toLang,
query: e,
transtype: i,
simple_means_flag: 3,
sign: b(e),
token: window.common.token,
domain: k.getCurDomain()
},
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
控制台输出一下 b(e)
,这个值就是我们想要的
b(e)
'232427.485594'
1
2
2
鼠标光标放到b上,左键单击进入方法
可以看到,这个方法就是生成 sign
的
执行js代码
我用的pycharm
,需要安装nodejs
环境
function sign(t) {
var o, i = t.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g);
if (null === i) {
var a = t.length;
a > 30 && (t = "".concat(t.substr(0, 10)).concat(t.substr(Math.floor(a / 2) - 5, 10)).concat(t.substr(-10, 10)))
} else {
for (var s = t.split(/[\uD800-\uDBFF][\uDC00-\uDFFF]/), c = 0, l = s.length, u = []; c < l; c++)
"" !== s[c] && u.push.apply(u, function (t) {
if (Array.isArray(t))
return e(t)
}(o = s[c].split("")) || function (t) {
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"])
return Array.from(t)
}(o) || function (t, n) {
if (t) {
if ("string" == typeof t)
return e(t, n);
var r = Object.prototype.toString.call(t).slice(8, -1);
return "Object" === r && t.constructor && (r = t.constructor.name),
"Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? e(t, n) : void 0
}
}(o) || function () {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
}()),
c !== l - 1 && u.push(i[c]);
var p = u.length;
p > 30 && (t = u.slice(0, 10).join("") + u.slice(Math.floor(p / 2) - 5, Math.floor(p / 2) + 5).join("") + u.slice(-10).join(""))
}
for (var d = "".concat(String.fromCharCode(103)).concat(String.fromCharCode(116)).concat(String.fromCharCode(107)), h = (null !== r ? r : (r = window[d] || "") || "").split("."), f = Number(h[0]) || 0, m = Number(h[1]) || 0, g = [], y = 0, v = 0; v < t.length; v++) {
var _ = t.charCodeAt(v);
_ < 128 ? g[y++] = _ : (_ < 2048 ? g[y++] = _ >> 6 | 192 : (55296 == (64512 & _) && v + 1 < t.length && 56320 == (64512 & t.charCodeAt(v + 1)) ? (_ = 65536 + ((1023 & _) << 10) + (1023 & t.charCodeAt(++v)),
g[y++] = _ >> 18 | 240,
g[y++] = _ >> 12 & 63 | 128) : g[y++] = _ >> 12 | 224,
g[y++] = _ >> 6 & 63 | 128),
g[y++] = 63 & _ | 128)
}
for (var b = f, w = "".concat(String.fromCharCode(43)).concat(String.fromCharCode(45)).concat(String.fromCharCode(97)) + "".concat(String.fromCharCode(94)).concat(String.fromCharCode(43)).concat(String.fromCharCode(54)), k = "".concat(String.fromCharCode(43)).concat(String.fromCharCode(45)).concat(String.fromCharCode(51)) + "".concat(String.fromCharCode(94)).concat(String.fromCharCode(43)).concat(String.fromCharCode(98)) + "".concat(String.fromCharCode(43)).concat(String.fromCharCode(45)).concat(String.fromCharCode(102)), x = 0; x < g.length; x++)
b = n(b += g[x], w);
return b = n(b, k),
(b ^= m) < 0 && (b = 2147483648 + (2147483647 & b)),
"".concat((b %= 1e6).toString(), ".").concat(b ^ f)
}
console.log(sign("你好"))
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
执行结果:
for (var d = "".concat(String.fromCharCode(103)).concat(String.fromCharCode(116)).concat(String.fromCharCode(107)), h = (null !== r ? r : (r = window[d] || "") || "").split("."), f = Number(h[0]) || 0, m = Number(h[1]) || 0, g = [], y = 0, v = 0; v < t.length; v++) {
^
ReferenceError: r is not defined
1
2
3
4
2
3
4
报错内容是r is not defined
,找不到r
定位到报错代码所在行,打个断点
重新发送请求,点跳转到下一个函数调用,执行
可以看到r是个字符串,内容为:"320305.131321201"
我们先把 r
写死
var r = "320305.131321201";
1
重新执行下js,报错找不到n方法
去找一下 n
方法,打个断定,继续执行脚本
找到n方法
function n(t, e) {
for (var n = 0; n < e.length - 2; n += 3) {
var r = e.charAt(n + 2);
r = "a" <= r ? r.charCodeAt(0) - 87 : Number(r),
r = "+" === e.charAt(n + 1) ? t >>> r : t << r,
t = "+" === e.charAt(n) ? t + r & 4294967295 : t ^ r
}
return t
}
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
完整代码js
function n(t, e) {
for (var n = 0; n < e.length - 2; n += 3) {
var r = e.charAt(n + 2);
r = "a" <= r ? r.charCodeAt(0) - 87 : Number(r),
r = "+" === e.charAt(n + 1) ? t >>> r : t << r,
t = "+" === e.charAt(n) ? t + r & 4294967295 : t ^ r
}
return t
}
var r = "320305.131321201";
function sign(t) {
var o, i = t.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g);
if (null === i) {
var a = t.length;
a > 30 && (t = "".concat(t.substr(0, 10)).concat(t.substr(Math.floor(a / 2) - 5, 10)).concat(t.substr(-10, 10)))
} else {
for (var s = t.split(/[\uD800-\uDBFF][\uDC00-\uDFFF]/), c = 0, l = s.length, u = []; c < l; c++)
"" !== s[c] && u.push.apply(u, function (t) {
if (Array.isArray(t))
return e(t)
}(o = s[c].split("")) || function (t) {
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"])
return Array.from(t)
}(o) || function (t, n) {
if (t) {
if ("string" == typeof t)
return e(t, n);
var r = Object.prototype.toString.call(t).slice(8, -1);
return "Object" === r && t.constructor && (r = t.constructor.name),
"Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? e(t, n) : void 0
}
}(o) || function () {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
}()),
c !== l - 1 && u.push(i[c]);
var p = u.length;
p > 30 && (t = u.slice(0, 10).join("") + u.slice(Math.floor(p / 2) - 5, Math.floor(p / 2) + 5).join("") + u.slice(-10).join(""))
}
for (var d = "".concat(String.fromCharCode(103)).concat(String.fromCharCode(116)).concat(String.fromCharCode(107)), h = (null !== r ? r : "").split("."), f = Number(h[0]) || 0, m = Number(h[1]) || 0, g = [], y = 0, v = 0; v < t.length; v++) {
var _ = t.charCodeAt(v);
_ < 128 ? g[y++] = _ : (_ < 2048 ? g[y++] = _ >> 6 | 192 : (55296 == (64512 & _) && v + 1 < t.length && 56320 == (64512 & t.charCodeAt(v + 1)) ? (_ = 65536 + ((1023 & _) << 10) + (1023 & t.charCodeAt(++v)),
g[y++] = _ >> 18 | 240,
g[y++] = _ >> 12 & 63 | 128) : g[y++] = _ >> 12 | 224,
g[y++] = _ >> 6 & 63 | 128),
g[y++] = 63 & _ | 128)
}
for (var b = f, w = "".concat(String.fromCharCode(43)).concat(String.fromCharCode(45)).concat(String.fromCharCode(97)) + "".concat(String.fromCharCode(94)).concat(String.fromCharCode(43)).concat(String.fromCharCode(54)), k = "".concat(String.fromCharCode(43)).concat(String.fromCharCode(45)).concat(String.fromCharCode(51)) + "".concat(String.fromCharCode(94)).concat(String.fromCharCode(43)).concat(String.fromCharCode(98)) + "".concat(String.fromCharCode(43)).concat(String.fromCharCode(45)).concat(String.fromCharCode(102)), x = 0; x < g.length; x++)
b = n(b += g[x], w);
return b = n(b, k),
(b ^= m) < 0 && (b = 2147483648 + (2147483647 & b)),
"".concat((b %= 1e6).toString(), ".").concat(b ^ f)
}
console.log(sign("你好"))
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
执行结果
232427.485594
1
和之前要的sign值一样
# python爬虫
在此网站上:https://curlconverter.com/
把cURL转换成python代码
pyhton代码:
import json
import requests
import execjs
def get_sign(vlues):
# 读取js文件的内容
with open('getSign.js', 'r', encoding='utf-8') as f:
js_code = f.read()
# 通过execjs.compile()进行编译js文件内容
compile_result = execjs.compile(js_code)
# 调用js文件传参
# weixin是js中的function方法名,inp是穿的参
result = compile_result.call('sign', vlues)
return result
def spider(value):
cookies = {
'BAIDUID': 'E7E4E0567FBE9DEDF43C583B9E60119F:FG=1',
'REALTIME_TRANS_SWITCH': '1',
'FANYI_WORD_SWITCH': '1',
'HISTORY_SWITCH': '1',
'SOUND_SPD_SWITCH': '1',
'SOUND_PREFER_SWITCH': '1',
'BIDUPSID': 'E7E4E0567FBE9DEDF43C583B9E60119F',
'PSTM': '1662006000',
'APPGUIDE_10_0_2': '1',
'BDORZ': 'B490B5EBF6F3CD402E515D22BCDA1598',
'H_PS_PSSID': '36547_38113_38359_38404_37862_38468_38174_38289_38257_37934_38382_26350_38417_37881',
'BDSFRCVID': '2AFOJeC629rz1DRfXd9v5P_3d5XzF9QTH6aomM5W3L3Q6y9KgdxmEG0Pqx8g0KAbMVkPogKKBmOTHn_F_2uxOjjg8UtVJeC6EG0Ptf8g0M5',
'H_BDCLCKID_SF': 'tJPJoKDbJKD3jR5m-R5HMtCyqxby2C62aJ0H5lQvWJ5TMC_wKRCaQhDEWM88-jQTXb7b_xnL3DTGShPC-tnVXjLiDPkeQ658fm3M0PnE3l02V-j9e-t2yU_VXJjWQPRMW23GWl7mWnrrsxA45J7cM4IseboJLfT-0bc4KKJxbnLWeIJEjj6jK4JKDGAOJ6cP',
'Hm_lvt_64ecd82404c51e03dc91cb9e8c025574': '1678884815,1679816757',
'delPer': '0',
'PSINO': '1',
'BAIDUID_BFESS': 'E7E4E0567FBE9DEDF43C583B9E60119F:FG=1',
'BDSFRCVID_BFESS': '2AFOJeC629rz1DRfXd9v5P_3d5XzF9QTH6aomM5W3L3Q6y9KgdxmEG0Pqx8g0KAbMVkPogKKBmOTHn_F_2uxOjjg8UtVJeC6EG0Ptf8g0M5',
'H_BDCLCKID_SF_BFESS': 'tJPJoKDbJKD3jR5m-R5HMtCyqxby2C62aJ0H5lQvWJ5TMC_wKRCaQhDEWM88-jQTXb7b_xnL3DTGShPC-tnVXjLiDPkeQ658fm3M0PnE3l02V-j9e-t2yU_VXJjWQPRMW23GWl7mWnrrsxA45J7cM4IseboJLfT-0bc4KKJxbnLWeIJEjj6jK4JKDGAOJ6cP',
'Hm_lpvt_64ecd82404c51e03dc91cb9e8c025574': '1679827229',
'ab_sr': '1.0.1_ZDc2NWQ5ODZiNDI1NjczMTRjYjRlNWY3YTNhZmY2ODAyZjcxM2MyZmM1ODQ1ZTg4NTIwYmNlOWMwYjk4ZjFhMjQzNTBjMzVjYzg4NTMxODI0NWEyNDBiNDljYWEyOGY1YTlkZWQyMzAwZmU3MGY0N2ZiZjEzMjM5ZDZkOWM3NjA2MzAxMTE0OTkxNTFhNTMwYmI5OTM5OGNkZTFiZjhiNA==',
}
headers = {
'Accept': '*/*',
'Accept-Language': 'zh-CN,zh;q=0.9',
'Acs-Token': '1679831923507_1679831922998_WgGGMV2Y27GwWX9/lcuaMP6Dn3dAzyKShwVfdY3ZvbGZlRi8qcN5M+d4u6tZoV0uV+9HmN2ZaofOexoL6zE8Y6dT7j1AzIF96PjQK5W6ODi5XZ5h2+fNVgP+zZXlhHzr0v2C4Q36HXgFR60nlxaPJG/1Ss+CNd71j94XdKAKMzsaSbJJ4XBxQrmHcUc4uDvtyjFIjn5xCiyhh9fWML6lXakNjAtPDAr0QnoufugFaaQGbzhYaLWRnm7GeV1vHwC9eBW6pDnHmzFmV1dEIJ8PD86wGQwIfJi0l/NJNJaYB5/RLCkajs3XfEAmhDqI+uGPNGy9rimDqL15qldEPYwSNcWsJh8q1A0eMvvxJMfRQ+8=',
'Connection': 'keep-alive',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
# 'Cookie': 'BAIDUID=E7E4E0567FBE9DEDF43C583B9E60119F:FG=1; REALTIME_TRANS_SWITCH=1; FANYI_WORD_SWITCH=1; HISTORY_SWITCH=1; SOUND_SPD_SWITCH=1; SOUND_PREFER_SWITCH=1; BIDUPSID=E7E4E0567FBE9DEDF43C583B9E60119F; PSTM=1662006000; APPGUIDE_10_0_2=1; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; H_PS_PSSID=36547_38113_38359_38404_37862_38468_38174_38289_38257_37934_38382_26350_38417_37881; BDSFRCVID=2AFOJeC629rz1DRfXd9v5P_3d5XzF9QTH6aomM5W3L3Q6y9KgdxmEG0Pqx8g0KAbMVkPogKKBmOTHn_F_2uxOjjg8UtVJeC6EG0Ptf8g0M5; H_BDCLCKID_SF=tJPJoKDbJKD3jR5m-R5HMtCyqxby2C62aJ0H5lQvWJ5TMC_wKRCaQhDEWM88-jQTXb7b_xnL3DTGShPC-tnVXjLiDPkeQ658fm3M0PnE3l02V-j9e-t2yU_VXJjWQPRMW23GWl7mWnrrsxA45J7cM4IseboJLfT-0bc4KKJxbnLWeIJEjj6jK4JKDGAOJ6cP; Hm_lvt_64ecd82404c51e03dc91cb9e8c025574=1678884815,1679816757; delPer=0; PSINO=1; BAIDUID_BFESS=E7E4E0567FBE9DEDF43C583B9E60119F:FG=1; BDSFRCVID_BFESS=2AFOJeC629rz1DRfXd9v5P_3d5XzF9QTH6aomM5W3L3Q6y9KgdxmEG0Pqx8g0KAbMVkPogKKBmOTHn_F_2uxOjjg8UtVJeC6EG0Ptf8g0M5; H_BDCLCKID_SF_BFESS=tJPJoKDbJKD3jR5m-R5HMtCyqxby2C62aJ0H5lQvWJ5TMC_wKRCaQhDEWM88-jQTXb7b_xnL3DTGShPC-tnVXjLiDPkeQ658fm3M0PnE3l02V-j9e-t2yU_VXJjWQPRMW23GWl7mWnrrsxA45J7cM4IseboJLfT-0bc4KKJxbnLWeIJEjj6jK4JKDGAOJ6cP; Hm_lpvt_64ecd82404c51e03dc91cb9e8c025574=1679827229; ab_sr=1.0.1_ZDc2NWQ5ODZiNDI1NjczMTRjYjRlNWY3YTNhZmY2ODAyZjcxM2MyZmM1ODQ1ZTg4NTIwYmNlOWMwYjk4ZjFhMjQzNTBjMzVjYzg4NTMxODI0NWEyNDBiNDljYWEyOGY1YTlkZWQyMzAwZmU3MGY0N2ZiZjEzMjM5ZDZkOWM3NjA2MzAxMTE0OTkxNTFhNTMwYmI5OTM5OGNkZTFiZjhiNA==',
'Origin': 'https://fanyi.baidu.com',
'Referer': 'https://fanyi.baidu.com/',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36',
'X-Requested-With': 'XMLHttpRequest',
'sec-ch-ua': '"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwa19pZCI6MSwiYV9pZCI6IiIsImR0eXBlIjoxLCJpZCI6MSwiZXhwIjoxNjc4NzI0MTQxLCJ0eXBlIjoieXp5IiwiaWF0IjoxNjc4NzE2OTQxfQ.Ztx8Dp3ooCtz9nc5XF6tQ3CFatDTeb4gXwxbG14B780',
'uid': '1',
}
params = {
'from': 'zh',
'to': 'en',
}
data = {
'from': 'zh',
'to': 'en',
'query': value,
'transtype': 'translang',
'simple_means_flag': '3',
'sign': get_sign(value),
'token': '34032f562bee3207e4dc0085490c43e3',
'domain': 'common',
}
response = requests.post('https://fanyi.baidu.com/v2transapi', params=params, cookies=cookies, headers=headers,
data=data)
res = json.loads(response.text)
print(res)
if __name__ == '__main__':
spider('你好')
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
js:
function n(t, e) {
for (var n = 0; n < e.length - 2; n += 3) {
var r = e.charAt(n + 2);
r = "a" <= r ? r.charCodeAt(0) - 87 : Number(r),
r = "+" === e.charAt(n + 1) ? t >>> r : t << r,
t = "+" === e.charAt(n) ? t + r & 4294967295 : t ^ r
}
return t
}
var r = "320305.131321201";
function sign(t) {
var o, i = t.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g);
if (null === i) {
var a = t.length;
a > 30 && (t = "".concat(t.substr(0, 10)).concat(t.substr(Math.floor(a / 2) - 5, 10)).concat(t.substr(-10, 10)))
} else {
for (var s = t.split(/[\uD800-\uDBFF][\uDC00-\uDFFF]/), c = 0, l = s.length, u = []; c < l; c++)
"" !== s[c] && u.push.apply(u, function (t) {
if (Array.isArray(t))
return e(t)
}(o = s[c].split("")) || function (t) {
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"])
return Array.from(t)
}(o) || function (t, n) {
if (t) {
if ("string" == typeof t)
return e(t, n);
var r = Object.prototype.toString.call(t).slice(8, -1);
return "Object" === r && t.constructor && (r = t.constructor.name),
"Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? e(t, n) : void 0
}
}(o) || function () {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
}()),
c !== l - 1 && u.push(i[c]);
var p = u.length;
p > 30 && (t = u.slice(0, 10).join("") + u.slice(Math.floor(p / 2) - 5, Math.floor(p / 2) + 5).join("") + u.slice(-10).join(""))
}
for (var d = "".concat(String.fromCharCode(103)).concat(String.fromCharCode(116)).concat(String.fromCharCode(107)), h = (null !== r ? r : "").split("."), f = Number(h[0]) || 0, m = Number(h[1]) || 0, g = [], y = 0, v = 0; v < t.length; v++) {
var _ = t.charCodeAt(v);
_ < 128 ? g[y++] = _ : (_ < 2048 ? g[y++] = _ >> 6 | 192 : (55296 == (64512 & _) && v + 1 < t.length && 56320 == (64512 & t.charCodeAt(v + 1)) ? (_ = 65536 + ((1023 & _) << 10) + (1023 & t.charCodeAt(++v)),
g[y++] = _ >> 18 | 240,
g[y++] = _ >> 12 & 63 | 128) : g[y++] = _ >> 12 | 224,
g[y++] = _ >> 6 & 63 | 128),
g[y++] = 63 & _ | 128)
}
for (var b = f, w = "".concat(String.fromCharCode(43)).concat(String.fromCharCode(45)).concat(String.fromCharCode(97)) + "".concat(String.fromCharCode(94)).concat(String.fromCharCode(43)).concat(String.fromCharCode(54)), k = "".concat(String.fromCharCode(43)).concat(String.fromCharCode(45)).concat(String.fromCharCode(51)) + "".concat(String.fromCharCode(94)).concat(String.fromCharCode(43)).concat(String.fromCharCode(98)) + "".concat(String.fromCharCode(43)).concat(String.fromCharCode(45)).concat(String.fromCharCode(102)), x = 0; x < g.length; x++)
b = n(b += g[x], w);
return b = n(b, k),
(b ^= m) < 0 && (b = 2147483648 + (2147483647 & b)),
"".concat((b %= 1e6).toString(), ".").concat(b ^ f)
}
console.log(sign("你好"))
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
运行结果
在 GitHub 上编辑此页 (opens new window)
最后更新: 2023/03/27, 13:03:00