@yiuayiu/functions 0.0.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.
@@ -0,0 +1,4 @@
1
+ /// <reference types="node" />
2
+ import crypto from "crypto";
3
+ export declare function sha1(string: crypto.BinaryLike): string;
4
+ export declare function md5(string: crypto.BinaryLike): string;
@@ -0,0 +1,7 @@
1
+ import crypto from "crypto";
2
+ export function sha1(string) {
3
+ return crypto.createHash("sha1").update(string).digest("hex");
4
+ }
5
+ export function md5(string) {
6
+ return crypto.createHash("md5").update(string).digest("hex");
7
+ }
package/functions.ts ADDED
@@ -0,0 +1,9 @@
1
+ import crypto from "crypto";
2
+
3
+ export function sha1(string: crypto.BinaryLike) {
4
+ return crypto.createHash("sha1").update(string).digest("hex");
5
+ }
6
+
7
+ export function md5(string: crypto.BinaryLike) {
8
+ return crypto.createHash("md5").update(string).digest("hex");
9
+ }
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@yiuayiu/functions",
3
+ "version": "0.0.1",
4
+ "description": "",
5
+ "main": "dist/functions.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "AYiU <npm@ayiu.net>",
11
+ "license": "ISC",
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "devDependencies": {
16
+ "@types/node": "^18.6.5"
17
+ }
18
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ }
6
+ }