qsu 1.0.2 → 1.0.3
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/dist/index.js +2 -2
- package/package.json +6 -2
package/dist/index.js
CHANGED
|
@@ -174,7 +174,7 @@ export default class Qsu {
|
|
|
174
174
|
return convStr;
|
|
175
175
|
}
|
|
176
176
|
static encrypt(str, secret, algorithm = 'aes-256-cbc', ivSize = 16) {
|
|
177
|
-
if (str.length < 1) {
|
|
177
|
+
if (!str || str.length < 1) {
|
|
178
178
|
return '';
|
|
179
179
|
}
|
|
180
180
|
const iv = crypto.randomBytes(ivSize);
|
|
@@ -184,7 +184,7 @@ export default class Qsu {
|
|
|
184
184
|
return `${iv.toString('hex')}:${enc.toString('hex')}`;
|
|
185
185
|
}
|
|
186
186
|
static decrypt(str, secret, algorithm = 'aes-256-cbc') {
|
|
187
|
-
if (str.length < 1) {
|
|
187
|
+
if (!str || str.length < 1) {
|
|
188
188
|
return '';
|
|
189
189
|
}
|
|
190
190
|
const arrStr = str.split(':');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qsu",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Quick and Simple Utility for javascript",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -36,7 +36,11 @@
|
|
|
36
36
|
"tool",
|
|
37
37
|
"underscore",
|
|
38
38
|
"website",
|
|
39
|
-
"helper"
|
|
39
|
+
"helper",
|
|
40
|
+
"array",
|
|
41
|
+
"string",
|
|
42
|
+
"date",
|
|
43
|
+
"math"
|
|
40
44
|
],
|
|
41
45
|
"devDependencies": {
|
|
42
46
|
"@types/node": "^17.0.35",
|