@yqg/simple 1.0.0 → 1.0.1-beta.1.1

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/src/util/tool.js CHANGED
@@ -5,47 +5,6 @@
5
5
  * @Last Modified time: 2022-10-20 18:15:32
6
6
  */
7
7
 
8
- import CryptoJS from 'crypto-js';
9
-
10
- const CALL_SECRET = 'ainiliangwannian';
11
- /**
12
- * AES 解密
13
- * @param ciphertext, key
14
- * @returns utf8字符串
15
- */
16
- export const aesDecrypt = (ciphertext, key = CALL_SECRET) => {
17
- if (ciphertext) {
18
- const encodeKey = CryptoJS.enc.Utf8.parse(key);
19
- const decrypted = CryptoJS.AES.decrypt(ciphertext, encodeKey, {
20
- mode: CryptoJS.mode.ECB,
21
- padding: CryptoJS.pad.Pkcs7
22
- });
23
-
24
- return decrypted.toString(CryptoJS.enc.Utf8);
25
- }
26
-
27
- return ciphertext;
28
- };
29
-
30
- /**
31
- * AES 加密
32
- * @param message, key
33
- * @returns 密码对象Base64字符串
34
- */
35
- export const aesEncrypt = (message, key = CALL_SECRET) => {
36
- if (message) {
37
- const encodeKey = CryptoJS.enc.Utf8.parse(key);
38
- const ciphertext = CryptoJS.AES.encrypt(message, encodeKey, {
39
- mode: CryptoJS.mode.ECB,
40
- padding: CryptoJS.pad.Pkcs7
41
- });
42
-
43
- return ciphertext.toString();
44
- }
45
-
46
- return message;
47
- };
48
-
49
8
  const isString = value => (typeof value === 'string');
50
9
  /* 驼峰转换为下划线链接,例如camelStr => camel_str */
51
10
  export const camelCaseToUnderscore = camelStr => (