Documentation ¶
Overview ¶
Package common contain the common functions of the challenger and the requester.
This package should'nt be used by users. This functions should be colled from the pow package witch calls those functions.
Index ¶
- func ByteToBits(x byte) (ret [8]byte)
- func CheckLastByteEqual(respByte, serverComputing []byte, diff uint16) bool
- func ConcatIDAndTestSolution(id, try []byte) []byte
- func EqualByte(b1, b2 byte, diff uint16) bool
- func GetDiffAsByte(diff uint16) uint
- func Hash(t *TryStruct) ([]byte, error)
- func IDToSlice(id uint64) []byte
- func Try(t *TryStruct, tryChan chan *TryResponse)
- type TryResponse
- type TryStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteToBits ¶
ByteToBits convert a byte into a slice of bits
func CheckLastByteEqual ¶
func ConcatIDAndTestSolution ¶
ConcatIDAndTestSolution make a string containing the challenge ID and the try. It make the try unique for any challenge
func GetDiffAsByte ¶
GetDiffAsByte returns the numbers of bytes needed to hold the this numbers of bits.
func Try ¶
func Try(t *TryStruct, tryChan chan *TryResponse)
Try try the given solution and return the result into the given channel
Types ¶
type TryResponse ¶
TryResponse represent the response of the try.
Click to show internal directories.
Click to hide internal directories.