Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrExtInvalid = fmt.Errorf("extension sum invalid") ErrHashcashEmpty = fmt.Errorf("hashcash empty") )
Functions ¶
This section is empty.
Types ¶
type ExtGeneratorFunc ¶
type ExtValidatorFunc ¶
type Hashcach ¶
type Hashcach struct { Version int32 Bits int32 Date time.Time Resource string Ext string Rand []byte Counter int64 }
Hashcach struct to marshal and unmarshal hashcach to string or proto buf
func InitHashcash ¶
func InitHashcash(bits int32, resource string, extGenerator ExtGeneratorFunc) (*Hashcach, error)
InitHashcash initiate new hashcash
func NewHashcach ¶
type Options ¶
type Options func(*options)
func WithValidateExtFunc ¶
func WithValidateExtFunc(callback ExtValidatorFunc) Options
Click to show internal directories.
Click to hide internal directories.