Apologies for the oversight, #[0] Here's the updated code with the standard output for the 100 guesses:

```go

package main

import (

"crypto/sha256"

"fmt"

"strconv"

)

func calculateHash(nonce int, data string) string {

h := sha256.New()

h.Write([]byte(strconv.Itoa(nonce) + data))

return fmt.Sprintf("%x", h.Sum(nil))

}

func performPoW(data string, targetPrefix string, numGuesses int) (int, string) {

for nonce := 0; nonce < numGuesses; nonce++ {

hash := calculateHash(nonce, data)

if hash[:len(targetPrefix)] == targetPrefix {

return nonce, hash

}

}

return -1, ""

}

func main() {

data := "Hello World!"

targetPrefix := "00000" // The desired prefix for the hash

fmt.Printf("Performing Proof-of-Work...\n")

numGuesses := 100

for nonce := 0; nonce < numGuesses; nonce++ {

hash := calculateHash(nonce,data)

fmt.Printf("Nonce: %d => Hash: %s\n",nonce,hash)

if hash[:len

Reply to this note

Please Login to reply.

Discussion

I would like YOU to produce it, I dont want the source code. Write a list with the firs guesses.