Skip to content
This repository was archived by the owner on Jul 4, 2024. It is now read-only.

Commit 7a1ef6f

Browse files
committed
zero deps
1 parent cb6ea36 commit 7a1ef6f

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

api/index.js

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
1-
const sha256 = require("js-sha256");
2-
const sha512 = require("js-sha512");
3-
const argon2 = require("argon2");
4-
5-
async function hash_it(str) {
6-
try {
7-
const hash = await argon2.hash(str);
8-
const newHash = await hash.replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\]\\]/gi, "");
9-
const ultraNewHash = await newHash.replace("argon"," ");
10-
console.log(ultraNewHash);
11-
} catch (err) {
12-
console.log(err);
13-
}
14-
}
15-
161
module.exports = (req,res) => {
172
const randomStr = Math.random()
183
.toString(36)
194
.replace(".", "");
20-
const moreRandomStr = sha256(randomStr);
21-
const ultraRandomStr = sha512(moreRandomStr).replace("."," ");
22-
const test = hash_it(ultraRandomStr);
23-
console.log(test);
5+
const moreRandomStr = Math.random(randomStr).toString(36);
6+
const ultraRandomStr = Math.random(moreRandomStr).toString(36);
247
res.send(`${ultraRandomStr}`);
258
};

package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
"test": "node api/index.js",
88
"lint": "eslint --fix ."
99
},
10-
"dependencies": {
11-
"argon2": "^0.28.2",
12-
"js-sha256": "^0.9.0",
13-
"js-sha512": "^0.8.0"
14-
},
1510
"devDependencies": {
1611
"eslint": "^7.32.0",
1712
"vercel": "^23.1.2"

0 commit comments

Comments
 (0)