Skip to content

Commit

Permalink
use strict, tested on nodejs v10+
Browse files Browse the repository at this point in the history
  • Loading branch information
h0rn3t committed Jun 23, 2020
1 parent 030848c commit 387dc8d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/xxtea.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict"
let delta = 0x9E3779B9;


Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "xxtea",
"version": "0.2.1",
"version": "0.2.2",
"license": "MIT",
"dist-tags": { "latest": "0.2.1" },
"versions": [ "0.2.1", "0.2.0", "0.1.2", "0.1.1"],
"description": "xxtea encription algorithm in pure javascript",
"dist-tags": { "latest": "0.2.2" },
"versions": [ "0.2.2","0.2.1", "0.2.0", "0.1.2", "0.1.1"],
"description": "xxtea encryption algorithm in pure javascript",
"keywords": [
"encription",
"crypt",
Expand All @@ -25,6 +25,6 @@
"bugs": {
"url": "https://github.com/h0rn3t/xxtea/issues"
},
"_id": "[email protected].1",
"_id": "[email protected].2",
"_from": "xxtea@"
}
8 changes: 7 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,10 @@ console.log(xxtea.decrypt(data, 'cryptkey')); // => "Привет!"
// with Russian + Eng
data = xxtea.encrypt('олололо http://русскийтекст', 'cryptkey');
console.log(data);
console.log(xxtea.decrypt(data, 'cryptkey')); // => "Hi!"
console.log(xxtea.decrypt(data, 'cryptkey')); // => "Hi!"


// with Russian + Eng + China
data = xxtea.encrypt('олололо http://русскийтекст 试验', 'cryptkeycryptkey');
console.log(data);
console.log(xxtea.decrypt(data, 'cryptkeycryptkey')); // => "Hi!"

0 comments on commit 387dc8d

Please sign in to comment.