@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 CHANGED
@@ -5,3 +5,11 @@
5
5
  ![License](https://img.shields.io/npm/l/@bbk47/toolbox)
6
6
 
7
7
  A tool library for bbk/abc
8
+
9
+ ## feature
10
+
11
+ - aes encrypt
12
+ - logger util
13
+ - md5 encrypt
14
+ - socks5 addr parse
15
+ - uuid util
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbk47/toolbox",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "toolbox for bbk",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
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