gomcaptcha/examples/main.go

28 lines
578 B
Go

// SPDX-FileCopyrightText: 2024 Aravinth Manivannan <realaravinth@batsense.net>
//
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
package main
import (
"C"
"fmt"
"git.batsense.net/mCaptcha/gomcaptcha"
)
func main() {
salt := "56126a526f6f1e6728e904d8b574ebb8"
phrase := "ef055efeac72b99ed24af687e49d6ec7"
difficulty := uint(50000)
res := gomcaptcha.ProveWork(salt, phrase, difficulty)
fmt.Println(res.Nonce)
fmt.Println(res.Result)
fmt.Println(res.IsSufficientDifficulty(salt, difficulty))
fmt.Println(res.IsValidProof(phrase, salt))
}