Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultBitStrength = 22 DefaultSaltSize = 16 )
Functions ¶
This section is empty.
Types ¶
type HashCash ¶
type HashCash struct {
Counter int64 `json:"counter"`
Resource []byte `json:"resource"`
*WorkOptions
}
func NewHashCash ¶
func NewHashCash(resource []byte, opts ...*WorkOptions) *HashCash
func (HashCash) CounterBytes ¶
func (HashCash) MarshalJSON ¶
func (HashCash) UnmarshalJSON ¶
type HashCashExt ¶
type HashCashExt struct {
Timestamp int64 `json:"timestamp"`
*RawHashCash
}
This is a special version of the HashCash that has the types we want to be importing / exporting.
type RawHashCash ¶
type RawHashCash HashCash
An alias type that won't have any of functions (mostly to avoid an infinite loop with the overidden MarshalJSON function)
type RawStrongWork ¶
type RawStrongWork StrongWork
An alias type that won't have any of functions (mostly to avoid an infinite loop with the overidden MarshalJSON function)
type StrongWork ¶
type StrongWork struct {
Counter int64 `json:"counter"`
Resource []byte `json:"resource"`
*WorkOptions
}
func NewStrongWork ¶
func NewStrongWork(resource []byte, opts ...*WorkOptions) *StrongWork
func (StrongWork) Check ¶
func (sw StrongWork) Check() bool
func (StrongWork) ContentHash ¶
func (sw StrongWork) ContentHash() []byte
func (*StrongWork) FindProof ¶
func (sw *StrongWork) FindProof()
func (StrongWork) MarshalJSON ¶
func (wo StrongWork) MarshalJSON() ([]byte, error)
func (StrongWork) UnmarshalJSON ¶
func (wo StrongWork) UnmarshalJSON(data []byte) error
func (StrongWork) ZeroCount ¶
func (sw StrongWork) ZeroCount() int
type StrongWorkExt ¶
type StrongWorkExt struct {
Timestamp int64 `json:"timestamp"`
*RawStrongWork
}
This is a special version of the StrongWork that has the types we want to be importing / exporting.
Click to show internal directories.
Click to hide internal directories.