@bbk47/toolbox 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/lib/logger.js +1 -1
- package/package.json +1 -1
- package/ss.js +8 -0
- package/test/encrypt.js +3 -0
package/README.md
CHANGED
package/lib/logger.js
CHANGED
|
@@ -17,7 +17,7 @@ function getCustomLogger(label, level) {
|
|
|
17
17
|
const colour = levelVal[key].colour;
|
|
18
18
|
return function (msg) {
|
|
19
19
|
let date = dateFormat('yyyy/MM/dd hh:mm:ss', new Date());
|
|
20
|
-
prefix = `${date} [${key[0].toUpperCase()}] ${label} `;
|
|
20
|
+
var prefix = `${date} [${key[0].toUpperCase()}] ${label} `;
|
|
21
21
|
console.log(colour, prefix, msg);
|
|
22
22
|
};
|
|
23
23
|
} else {
|
package/package.json
CHANGED
package/ss.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const encrypt = require('./lib/encrypt')
|
|
2
|
+
|
|
3
|
+
const worker = new encrypt.Encryptor('csii2019', 'aes-256-cfb');
|
|
4
|
+
|
|
5
|
+
const result1 = worker.encrypt(Buffer.from('hello,world'));
|
|
6
|
+
const result12 = worker.encrypt(Buffer.from('hello,world'));
|
|
7
|
+
console.log(result1)
|
|
8
|
+
console.log(result12)
|
package/test/encrypt.js
CHANGED
|
@@ -7,6 +7,9 @@ describe('encrypt', function () {
|
|
|
7
7
|
const worker = new encrypt.Encryptor('csii2019', 'aes-256-cfb');
|
|
8
8
|
|
|
9
9
|
const result1 = worker.encrypt(Buffer.from('hello,world'));
|
|
10
|
+
const result12 = worker.encrypt(Buffer.from('hello,world'));
|
|
11
|
+
console.log(result1)
|
|
12
|
+
console.log(result2)
|
|
10
13
|
const result2 = worker.encrypt(Buffer.from('818c9ba2109b4c505155aebf6d3647a3'));
|
|
11
14
|
const result3 = worker.encrypt(Buffer.from('818c9ba2109b4c505155aebf6d3647a2'));
|
|
12
15
|
|