@pdg/crypto 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/dist/index.esm.js +9 -11
- package/dist/index.js +9 -11
- package/package.json +9 -3
package/dist/index.esm.js
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import _md5 from'md5';import _base64 from'base-64';import utf8 from'utf8';import sha from'sha.js';function md5(text) {
|
|
2
2
|
return _md5(text);
|
|
3
|
-
}
|
|
4
|
-
encode
|
|
3
|
+
}const base64 = {
|
|
4
|
+
encode(text) {
|
|
5
5
|
return _base64.encode(utf8.encode(text));
|
|
6
6
|
},
|
|
7
|
-
decode
|
|
7
|
+
decode(encodedText) {
|
|
8
8
|
return utf8.decode(_base64.decode(encodedText));
|
|
9
9
|
},
|
|
10
|
-
};function sha1(text, encoding) {
|
|
11
|
-
if (encoding === void 0) { encoding = 'hex'; }
|
|
10
|
+
};function sha1(text, encoding = 'hex') {
|
|
12
11
|
return sha('sha1').update(utf8.encode(text)).digest(encoding);
|
|
13
|
-
}function sha256(text, encoding) {
|
|
14
|
-
if (encoding === void 0) { encoding = 'hex'; }
|
|
12
|
+
}function sha256(text, encoding = 'hex') {
|
|
15
13
|
return sha('sha256').update(utf8.encode(text)).digest(encoding);
|
|
16
14
|
}var index = {
|
|
17
|
-
md5
|
|
18
|
-
base64
|
|
19
|
-
sha1
|
|
20
|
-
sha256
|
|
15
|
+
md5,
|
|
16
|
+
base64,
|
|
17
|
+
sha1,
|
|
18
|
+
sha256,
|
|
21
19
|
};export{base64,index as default,md5,sha1,sha256};
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _md5=require('md5'),_base64=require('base-64'),utf8=require('utf8'),sha=require('sha.js');function md5(text) {
|
|
2
2
|
return _md5(text);
|
|
3
|
-
}
|
|
4
|
-
encode
|
|
3
|
+
}const base64 = {
|
|
4
|
+
encode(text) {
|
|
5
5
|
return _base64.encode(utf8.encode(text));
|
|
6
6
|
},
|
|
7
|
-
decode
|
|
7
|
+
decode(encodedText) {
|
|
8
8
|
return utf8.decode(_base64.decode(encodedText));
|
|
9
9
|
},
|
|
10
|
-
};function sha1(text, encoding) {
|
|
11
|
-
if (encoding === void 0) { encoding = 'hex'; }
|
|
10
|
+
};function sha1(text, encoding = 'hex') {
|
|
12
11
|
return sha('sha1').update(utf8.encode(text)).digest(encoding);
|
|
13
|
-
}function sha256(text, encoding) {
|
|
14
|
-
if (encoding === void 0) { encoding = 'hex'; }
|
|
12
|
+
}function sha256(text, encoding = 'hex') {
|
|
15
13
|
return sha('sha256').update(utf8.encode(text)).digest(encoding);
|
|
16
14
|
}var index = {
|
|
17
|
-
md5
|
|
18
|
-
base64
|
|
19
|
-
sha1
|
|
20
|
-
sha256
|
|
15
|
+
md5,
|
|
16
|
+
base64,
|
|
17
|
+
sha1,
|
|
18
|
+
sha256,
|
|
21
19
|
};exports.base64=base64;exports.default=index;exports.md5=md5;exports.sha1=sha1;exports.sha256=sha256;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@pdg/crypto",
|
|
3
3
|
"title": "Typescript Crypto Module",
|
|
4
4
|
"description": "Typescript Crypto Module",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.2",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"module": "./dist/index.esm.js",
|
|
@@ -30,9 +30,15 @@
|
|
|
30
30
|
"scripts": {
|
|
31
31
|
"dev": "cd examples && npm run dev",
|
|
32
32
|
"build": "npm run test && npm run lint && rollup -c --bundleConfigAsCjs",
|
|
33
|
+
"git:commit": "node .git-commit.cjs",
|
|
34
|
+
"git:push": "git push",
|
|
35
|
+
"git:commit:push": "npm run git:commit && npm run git:push",
|
|
36
|
+
"git:merge:mirror": "node .git-merge.cjs mirror main",
|
|
37
|
+
"reset:gitignore": "git rm -r --cached . && git add .",
|
|
33
38
|
"pub": "npm i && npm run build && npm publish --access=public && rm ./.git/hooks/pre-commit",
|
|
34
39
|
"lint": "eslint './src/**/*.ts'",
|
|
35
|
-
"reinstall
|
|
40
|
+
"reinstall": "npm run reinstall:module",
|
|
41
|
+
"reinstall:module": "rm -rf node_modules && rm -f package-lock.json && npm i",
|
|
36
42
|
"test": "jest"
|
|
37
43
|
},
|
|
38
44
|
"author": "YOUNG CHUL PARK",
|
|
@@ -72,7 +78,7 @@
|
|
|
72
78
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
73
79
|
"ts-jest": "^29.3.4",
|
|
74
80
|
"ts-node": "^10.9.2",
|
|
75
|
-
"typescript": "
|
|
81
|
+
"typescript": "5.8.3",
|
|
76
82
|
"typescript-eslint": "^8.33.0"
|
|
77
83
|
}
|
|
78
84
|
}
|