Skip to content

Commit ddf0dec

Browse files
committed
update package version
1 parent 485134c commit ddf0dec

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hubot-qq",
3-
"version": "1.3.1",
3+
"version": "1.4.0",
44

55
"author": "xhan",
66

@@ -25,7 +25,6 @@
2525
},
2626

2727
"dependencies": {
28-
"scoped-http-client": ">= 0.9.8",
2928
"log": ">= 1.4.0",
3029
"js-yaml" : ">= 3.0.0"
3130
},

tests/encrypt.js

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
b = function(b, i) {
2+
this.s = b || 0;
3+
this.e = i || 0
4+
}
5+
6+
P = function(i, a) {
7+
var j = [];
8+
j[0] = i >> 24 & 255;
9+
j[1] = i >> 16 & 255;
10+
j[2] = i >> 8 & 255;
11+
j[3] = i & 255;
12+
for (var s = [], e = 0; e < a.length; ++e) s.push(a.charCodeAt(e));
13+
e = [];
14+
for (e.push(new b(0, s.length - 1)); e.length > 0;) {
15+
var c = e.pop();
16+
if (!(c.s >= c.e || c.s < 0 || c.e >= s.length))
17+
if (c.s + 1 == c.e) {
18+
if (s[c.s] > s[c.e]) {
19+
var J = s[c.s];
20+
s[c.s] = s[c.e];
21+
s[c.e] = J
22+
}
23+
} else {
24+
for (var J = c.s, l = c.e, f = s[c.s]; c.s < c.e;) {
25+
for (; c.s < c.e && s[c.e] >= f;) c.e--, j[0] = j[0] + 3 & 255;
26+
c.s < c.e && (s[c.s] = s[c.e], c.s++, j[1] = j[1] * 13 + 43 & 255);
27+
for (; c.s < c.e && s[c.s] <= f;) c.s++, j[2] = j[2] - 3 & 255;
28+
c.s < c.e && (s[c.e] = s[c.s], c.e--, j[3] = (j[0] ^ j[1] ^ j[2] ^ j[3] + 1) & 255)
29+
}
30+
s[c.s] = f;
31+
e.push(new b(J, c.s - 1));
32+
e.push(new b(c.s + 1, l))
33+
}
34+
}
35+
s = ["0", "1", "2", "3", "4",
36+
"5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"
37+
];
38+
e = "";
39+
for (c = 0; c < j.length; c++) e += s[j[c] >> 4 & 15], e += s[j[c] & 15];
40+
return e
41+
}
42+
43+
console.log( P("aaaaasdfdf","bbxxxxxff") )
44+

0 commit comments

Comments
 (0)