Skip to content

Commit 387dc8d

Browse files
committed
use strict, tested on nodejs v10+
1 parent 030848c commit 387dc8d

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

lib/xxtea.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use strict"
12
let delta = 0x9E3779B9;
23

34

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "xxtea",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"license": "MIT",
5-
"dist-tags": { "latest": "0.2.1" },
6-
"versions": [ "0.2.1", "0.2.0", "0.1.2", "0.1.1"],
7-
"description": "xxtea encription algorithm in pure javascript",
5+
"dist-tags": { "latest": "0.2.2" },
6+
"versions": [ "0.2.2","0.2.1", "0.2.0", "0.1.2", "0.1.1"],
7+
"description": "xxtea encryption algorithm in pure javascript",
88
"keywords": [
99
"encription",
1010
"crypt",
@@ -25,6 +25,6 @@
2525
"bugs": {
2626
"url": "https://github.com/h0rn3t/xxtea/issues"
2727
},
28-
"_id": "[email protected].1",
28+
"_id": "[email protected].2",
2929
"_from": "xxtea@"
3030
}

test.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,10 @@ console.log(xxtea.decrypt(data, 'cryptkey')); // => "Привет!"
1717
// with Russian + Eng
1818
data = xxtea.encrypt('олололо http://русскийтекст', 'cryptkey');
1919
console.log(data);
20-
console.log(xxtea.decrypt(data, 'cryptkey')); // => "Hi!"
20+
console.log(xxtea.decrypt(data, 'cryptkey')); // => "Hi!"
21+
22+
23+
// with Russian + Eng + China
24+
data = xxtea.encrypt('олололо http://русскийтекст 试验', 'cryptkeycryptkey');
25+
console.log(data);
26+
console.log(xxtea.decrypt(data, 'cryptkeycryptkey')); // => "Hi!"

0 commit comments

Comments
 (0)