@pdg/crypto 1.0.0
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/dist/_md5.d.ts +2 -0
- package/dist/base64.d.ts +5 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.esm.js +21 -0
- package/dist/index.js +21 -0
- package/dist/sha1.d.ts +3 -0
- package/dist/sha256.d.ts +3 -0
- package/package.json +71 -0
package/README.md
ADDED
package/dist/_md5.d.ts
ADDED
package/dist/base64.d.ts
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './_md5';
|
|
2
|
+
export * from './base64';
|
|
3
|
+
export * from './sha1';
|
|
4
|
+
export * from './sha256';
|
|
5
|
+
import md5 from './_md5';
|
|
6
|
+
import sha1 from './sha1';
|
|
7
|
+
import sha256 from './sha256';
|
|
8
|
+
declare const _default: {
|
|
9
|
+
md5: typeof md5;
|
|
10
|
+
base64: {
|
|
11
|
+
encode(text: string): string;
|
|
12
|
+
decode(encodedText: string): string;
|
|
13
|
+
};
|
|
14
|
+
sha1: typeof sha1;
|
|
15
|
+
sha256: typeof sha256;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _md5 from'md5';import _base64 from'base-64';import utf8 from'utf8';import sha from'sha.js';function md5(text) {
|
|
2
|
+
return _md5(text);
|
|
3
|
+
}var base64 = {
|
|
4
|
+
encode: function (text) {
|
|
5
|
+
return _base64.encode(utf8.encode(text));
|
|
6
|
+
},
|
|
7
|
+
decode: function (encodedText) {
|
|
8
|
+
return utf8.decode(_base64.decode(encodedText));
|
|
9
|
+
},
|
|
10
|
+
};function sha1(text, encoding) {
|
|
11
|
+
if (encoding === void 0) { encoding = 'hex'; }
|
|
12
|
+
return sha('sha1').update(utf8.encode(text)).digest(encoding);
|
|
13
|
+
}function sha256(text, encoding) {
|
|
14
|
+
if (encoding === void 0) { encoding = 'hex'; }
|
|
15
|
+
return sha('sha256').update(utf8.encode(text)).digest(encoding);
|
|
16
|
+
}var index = {
|
|
17
|
+
md5: md5,
|
|
18
|
+
base64: base64,
|
|
19
|
+
sha1: sha1,
|
|
20
|
+
sha256: sha256,
|
|
21
|
+
};export{base64,index as default,md5,sha1,sha256};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
return _md5(text);
|
|
3
|
+
}var base64 = {
|
|
4
|
+
encode: function (text) {
|
|
5
|
+
return _base64.encode(utf8.encode(text));
|
|
6
|
+
},
|
|
7
|
+
decode: function (encodedText) {
|
|
8
|
+
return utf8.decode(_base64.decode(encodedText));
|
|
9
|
+
},
|
|
10
|
+
};function sha1(text, encoding) {
|
|
11
|
+
if (encoding === void 0) { encoding = 'hex'; }
|
|
12
|
+
return sha('sha1').update(utf8.encode(text)).digest(encoding);
|
|
13
|
+
}function sha256(text, encoding) {
|
|
14
|
+
if (encoding === void 0) { encoding = 'hex'; }
|
|
15
|
+
return sha('sha256').update(utf8.encode(text)).digest(encoding);
|
|
16
|
+
}var index = {
|
|
17
|
+
md5: md5,
|
|
18
|
+
base64: base64,
|
|
19
|
+
sha1: sha1,
|
|
20
|
+
sha256: sha256,
|
|
21
|
+
};exports.base64=base64;exports.default=index;exports.md5=md5;exports.sha1=sha1;exports.sha256=sha256;
|
package/dist/sha1.d.ts
ADDED
package/dist/sha256.d.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pdg/crypto",
|
|
3
|
+
"title": "Typescript Crypto Module",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "API Module",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.esm.js",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/parkdigy/crypto.git",
|
|
13
|
+
"baseUrl": "https://github.com/parkdigy/crypto"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/parkdigy/crypto/issues"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/parkdigy/crypto#readme",
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"dev": "cd examples && npm run dev",
|
|
25
|
+
"build": "npm run test && npm run lint && rollup -c --bundleConfigAsCjs",
|
|
26
|
+
"pub": "npm i && npm run build && npm publish --access=public && rm ./.git/hooks/pre-commit",
|
|
27
|
+
"lint": "eslint './src/**/*.ts'",
|
|
28
|
+
"reinstall-module": "rm -rf node_modules && rm -f package-lock.json && npm i",
|
|
29
|
+
"test": "jest"
|
|
30
|
+
},
|
|
31
|
+
"author": "YOUNG CHUL PARK",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"readmeFilename": "README.md",
|
|
34
|
+
"keywords": [
|
|
35
|
+
"util",
|
|
36
|
+
"typescript",
|
|
37
|
+
"javascript"
|
|
38
|
+
],
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@eslint/js": "^9.28.0",
|
|
41
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
42
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
43
|
+
"@types/base-64": "^1.0.2",
|
|
44
|
+
"@types/jest": "^29.5.14",
|
|
45
|
+
"@types/md5": "^2.3.5",
|
|
46
|
+
"@types/node": "^22.15.29",
|
|
47
|
+
"@types/sha.js": "^2.4.4",
|
|
48
|
+
"@types/utf8": "^3.0.3",
|
|
49
|
+
"@types/uuid": "^10.0.0",
|
|
50
|
+
"@typescript-eslint/parser": "^8.33.0",
|
|
51
|
+
"eslint": "9.28.0",
|
|
52
|
+
"eslint-config-prettier": "^10.1.5",
|
|
53
|
+
"eslint-plugin-prettier": "^5.4.1",
|
|
54
|
+
"jest": "^29.7.0",
|
|
55
|
+
"prettier": "^3.5.3",
|
|
56
|
+
"rollup": "^4.41.1",
|
|
57
|
+
"rollup-plugin-delete": "^2.2.0",
|
|
58
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
59
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
60
|
+
"ts-jest": "^29.3.4",
|
|
61
|
+
"ts-node": "^10.9.2",
|
|
62
|
+
"typescript": "^5.8.3",
|
|
63
|
+
"typescript-eslint": "^8.33.0"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"base-64": "^1.0.0",
|
|
67
|
+
"md5": "^2.3.0",
|
|
68
|
+
"sha.js": "^2.4.11",
|
|
69
|
+
"utf8": "^3.0.0"
|
|
70
|
+
}
|
|
71
|
+
}
|