challenger

package
v0.0.0-...-83390d5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2016 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveJSON

func ResolveJSON(input []byte, limits *ResolveLimits) ([]byte, error)

ResolveJSON is an alias of Resolve but take a slice of byte insted of the direct struct. It return the response as a JSON.

Types

type ResolveLimits

type ResolveLimits struct {
	Duration time.Duration
	Trys     uint64
	NbBytes  int // represent the limit of byte it can try, if 3 it will stop at [255,255,255] solution
}

ResolveLimits set some limits on the resolution

type Response

type Response struct {
	Solution []byte // The solution to the challenge

	Challenge *request.Challenge // The challenge refering to
}

Response is the element returned by the client to the server to give it's answer

func Resolve

func Resolve(challenge *request.Challenge, limits *ResolveLimits) (*Response, error)

Resolve get a challenge request as paramiter and try to resolve the given request

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL