We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87ec637 commit a5b50c6Copy full SHA for a5b50c6
1 file changed
index.html
@@ -50,22 +50,22 @@
50
"password"
51
]
52
53
- async function hash(pass) {
54
- const hash = await bcrypt.hash(pass + noAI, 3);
55
- return hash;
+ async function hash( pass ) {
+ return await bcrypt.hash(pass + "noAI", 8);
56
}
57
58
- async function check( item, index ) {
59
- works = hash(pass) === data[index];
+ async function check( pass ) {
+ for (const stored of data) {
+ const match = await bcrypt.compare(pass, stored);
60
+ if (match) return true;
61
+ }
62
+ return false
63
64
65
async function test() {
66
const input = await document.getElementById("in");
- const password = input.innerHTML;
- const works = false;
- data.forEach( check );
67
-
68
- if ( works ) {
+ const pass = input.innerHTML;
+ if ( check(pass) ) {
69
window.location = "/pass.html";
70
71
0 commit comments