Documentation ¶
Index ¶
- Constants
- Variables
- type Bytes
- type Difficulty
- func (d Difficulty) Add(v Difficulty) Difficulty
- func (d Difficulty) Add64(v uint64) Difficulty
- func (d Difficulty) And(v Difficulty) Difficulty
- func (d Difficulty) And64(v uint64) Difficulty
- func (d Difficulty) Big() *big.Int
- func (d Difficulty) Bytes() []byte
- func (d Difficulty) CheckPoW(pow Hash) bool
- func (d Difficulty) Cmp(v Difficulty) int
- func (d Difficulty) Cmp64(v uint64) int
- func (d Difficulty) Div(v Difficulty) Difficulty
- func (d Difficulty) Div64(v uint64) Difficulty
- func (d Difficulty) Equals(v Difficulty) bool
- func (d Difficulty) Equals64(v uint64) bool
- func (d Difficulty) Float64() float64
- func (d Difficulty) IsZero() bool
- func (d Difficulty) LeadingZeros() int
- func (d Difficulty) Len() int
- func (d Difficulty) Lsh(n uint) (s Difficulty)
- func (d Difficulty) MarshalJSON() ([]byte, error)
- func (d Difficulty) Mod(v Difficulty) (r Difficulty)
- func (d Difficulty) Mod64(v uint64) (r uint64)
- func (d Difficulty) Mul(v Difficulty) Difficulty
- func (d Difficulty) Mul64(v uint64) Difficulty
- func (d Difficulty) OnesCount() int
- func (d Difficulty) Or(v Difficulty) Difficulty
- func (d Difficulty) Or64(v uint64) Difficulty
- func (d Difficulty) PutBytes(b []byte)
- func (d Difficulty) PutBytesBE(b []byte)
- func (d Difficulty) QuoRem(v Difficulty) (q, r Difficulty)
- func (d Difficulty) QuoRem64(v uint64) (q Difficulty, r uint64)
- func (d Difficulty) Reverse() Difficulty
- func (d Difficulty) ReverseBytes() Difficulty
- func (d Difficulty) RotateLeft(k int) Difficulty
- func (d Difficulty) RotateRight(k int) Difficulty
- func (d Difficulty) Rsh(n uint) (s Difficulty)
- func (d *Difficulty) Scan(src any) error
- func (d Difficulty) String() string
- func (d Difficulty) StringNumeric() string
- func (d Difficulty) Sub(v Difficulty) Difficulty
- func (d Difficulty) Sub64(v uint64) Difficulty
- func (d Difficulty) Target() uint64
- func (d Difficulty) TrailingZeros() int
- func (d *Difficulty) UnmarshalJSON(b []byte) error
- func (d *Difficulty) Value() (driver.Value, error)
- func (d Difficulty) Xor(v Difficulty) Difficulty
- func (d Difficulty) Xor64(v uint64) Difficulty
- type Hash
Constants ¶
View Source
const DifficultySize = 16
View Source
const (
DonationAddress = "4AeEwC2Uik2Zv4uooAUWjQb2ZvcLDBmLXN4rzSn3wjBoY8EKfNkSUqeg5PxcnWTwB1b2V39PDwU9gaNE5SnxSQPYQyoQtr7"
)
View Source
const HashSize = 32
Variables ¶
View Source
var MaxDifficulty = Difficulty(uint128.Max)
View Source
var ZeroDifficulty = Difficulty(uint128.Zero)
Functions ¶
This section is empty.
Types ¶
type Difficulty ¶
func DifficultyFrom64 ¶
func DifficultyFrom64(v uint64) Difficulty
func DifficultyFromBytes ¶
func DifficultyFromBytes(buf []byte) Difficulty
func DifficultyFromPoW ¶
func DifficultyFromPoW(powHash Hash) Difficulty
func DifficultyFromString ¶
func DifficultyFromString(s string) (Difficulty, error)
func MustDifficultyFromString ¶
func MustDifficultyFromString(s string) Difficulty
func NewDifficulty ¶
func NewDifficulty(lo, hi uint64) Difficulty
func (Difficulty) And ¶
func (d Difficulty) And(v Difficulty) Difficulty
func (Difficulty) And64 ¶
func (d Difficulty) And64(v uint64) Difficulty
func (Difficulty) Bytes ¶
func (d Difficulty) Bytes() []byte
func (Difficulty) CheckPoW ¶
func (d Difficulty) CheckPoW(pow Hash) bool
func (Difficulty) Cmp ¶
func (d Difficulty) Cmp(v Difficulty) int
func (Difficulty) Cmp64 ¶
func (d Difficulty) Cmp64(v uint64) int
func (Difficulty) Div ¶
func (d Difficulty) Div(v Difficulty) Difficulty
func (Difficulty) Div64 ¶
func (d Difficulty) Div64(v uint64) Difficulty
func (Difficulty) Equals ¶
func (d Difficulty) Equals(v Difficulty) bool
func (Difficulty) Equals64 ¶
func (d Difficulty) Equals64(v uint64) bool
func (Difficulty) Float64 ¶
func (d Difficulty) Float64() float64
func (Difficulty) IsZero ¶
func (d Difficulty) IsZero() bool
func (Difficulty) LeadingZeros ¶
func (d Difficulty) LeadingZeros() int
func (Difficulty) Len ¶
func (d Difficulty) Len() int
func (Difficulty) Lsh ¶
func (d Difficulty) Lsh(n uint) (s Difficulty)
func (Difficulty) MarshalJSON ¶
func (d Difficulty) MarshalJSON() ([]byte, error)
func (Difficulty) Mod ¶
func (d Difficulty) Mod(v Difficulty) (r Difficulty)
func (Difficulty) Mod64 ¶
func (d Difficulty) Mod64(v uint64) (r uint64)
func (Difficulty) OnesCount ¶
func (d Difficulty) OnesCount() int
func (Difficulty) Or ¶
func (d Difficulty) Or(v Difficulty) Difficulty
func (Difficulty) Or64 ¶
func (d Difficulty) Or64(v uint64) Difficulty
func (Difficulty) PutBytes ¶
func (d Difficulty) PutBytes(b []byte)
func (Difficulty) PutBytesBE ¶
func (d Difficulty) PutBytesBE(b []byte)
func (Difficulty) QuoRem ¶
func (d Difficulty) QuoRem(v Difficulty) (q, r Difficulty)
func (Difficulty) QuoRem64 ¶
func (d Difficulty) QuoRem64(v uint64) (q Difficulty, r uint64)
func (Difficulty) Reverse ¶
func (d Difficulty) Reverse() Difficulty
func (Difficulty) ReverseBytes ¶
func (d Difficulty) ReverseBytes() Difficulty
func (Difficulty) RotateLeft ¶
func (d Difficulty) RotateLeft(k int) Difficulty
func (Difficulty) RotateRight ¶
func (d Difficulty) RotateRight(k int) Difficulty
func (Difficulty) Rsh ¶
func (d Difficulty) Rsh(n uint) (s Difficulty)
func (*Difficulty) Scan ¶
func (d *Difficulty) Scan(src any) error
func (Difficulty) String ¶
func (d Difficulty) String() string
func (Difficulty) StringNumeric ¶
func (d Difficulty) StringNumeric() string
func (Difficulty) Target ¶
func (d Difficulty) Target() uint64
Target Finds a 64-bit target for mining (target = 2^64 / difficulty) and rounds up the result of division Because of that, there's a very small chance that miners will find a hash that meets the target but is still wrong (hash * difficulty >= 2^256) A proper difficulty check is in check_pow()
func (Difficulty) TrailingZeros ¶
func (d Difficulty) TrailingZeros() int
func (*Difficulty) UnmarshalJSON ¶
func (d *Difficulty) UnmarshalJSON(b []byte) error
func (Difficulty) Xor ¶
func (d Difficulty) Xor(v Difficulty) Difficulty
func (Difficulty) Xor64 ¶
func (d Difficulty) Xor64(v uint64) Difficulty
type Hash ¶
var ZeroHash Hash
func HashFromBytes ¶
func HashFromString ¶
func MustHashFromString ¶
func (Hash) MarshalJSON ¶
func (*Hash) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.