Browse Source

thonk, 4 is too slow

master
SeraphJACK 3 years ago
parent
commit
63af5b2ee3
Signed by: SeraphJACK <seraphjack@outlook.com> GPG Key ID: 14162B46567AB06F
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      http/challenge.go
  2. +1
    -1
      static/js/worker.js

+ 1
- 1
http/challenge.go View File

@@ -30,7 +30,7 @@ func checkChallenge(ip net.IP, magic string) bool {
challenge := getChallenge(ip)
bytes := []byte(challenge + magic)
hash := sha256.Sum256(bytes[:])
for i := 0; i < 4; i++ {
for i := 0; i < 3; i++ {
if hash[i] != 0 {
return false
}


+ 1
- 1
static/js/worker.js View File

@@ -12,7 +12,7 @@ function findMagic(challengeString) {
if (challengeString !== null) {
for (let i=0n; true; i++) {
let result = sha256.array(challengeString + i.toString())
if (result[0] === 0 && result[1] === 0 && result[2] === 0 && result[3] === 0) {
if (result[0] === 0 && result[1] === 0 && result[2] === 0) {
return i.toString()
}
}


Loading…
Cancel
Save