Documentation ¶
Index ¶
- Constants
- func CheckProofOfWork(prefixToMatch []byte, hash []byte) bool
- func GetCompact(b *big.Int) uint32
- func GetDifficulty(bits uint32) (diff float64)
- func POWCheckProofOfWork(hash *Uint256, bits uint32) bool
- func Rimp160AfterSha256(b []byte) (out [20]byte)
- func RimpHash(in []byte, out []byte)
- func SetCompact(nCompact uint32) (res *big.Int)
- func Sha2Sum(b []byte) (out [32]byte)
- func ShaHash(b []byte, out []byte)
- type Uint256
Constants ¶
View Source
const Uint256IdxLen = 8 // The bigger it is, the more memory is needed, but lower chance of a collision
Variables ¶
This section is empty.
Functions ¶
func CheckProofOfWork ¶
CheckProofOfWork 确认POW是否匹配
func GetCompact ¶
func GetDifficulty ¶
func POWCheckProofOfWork ¶
func Rimp160AfterSha256 ¶
Returns hash: RIMP160( SHA256( data ) ) Where possible, using RimpHash() should be a bit faster
func SetCompact ¶
Types ¶
type Uint256 ¶
type Uint256 struct {
Hash [32]byte
}
func NewSha2Hash ¶
func NewUint256 ¶
func NewUint256FromString ¶
Get from MSB hexstring
func (*Uint256) BIdx ¶
func (u *Uint256) BIdx() (o [Uint256IdxLen]byte)
Click to show internal directories.
Click to hide internal directories.