Documentation
¶
Overview ¶
默克尔树
Package ripemd160 implements the RIPEMD-160 hash algorithm.
Deprecated: RIPEMD-160 is a legacy hash and should not be used for new applications. Also, this package does not and will not provide an optimized implementation. Instead, use a modern hash like SHA-256 (from crypto/sha256).
Index ¶
- Constants
- func Base58Decode(input []byte) []byte
- func Base58Encode(input []byte) []byte
- func BytesToInt(bys []byte) int
- func GenerateRealRandom() int64
- func Int64ToBytes(i int64) []byte
- func NewRipemd160() hash.Hash
- func RandomInRange(min int, max int) int
- func Uint64Pow(n, m uint64) uint64
- func Uint64ToBytes(i uint64) []byte
- type MerkelNode
- type MerkelTree
Constants ¶
View Source
const BlockSize = 64
The block size of the hash algorithm in bytes.
View Source
const Size = 20
The size of the checksum in bytes.
Variables ¶
This section is empty.
Functions ¶
func NewRipemd160 ¶
New returns a new hash.Hash computing the checksum.
func RandomInRange ¶
Types ¶
type MerkelNode ¶
type MerkelNode struct { Left *MerkelNode Right *MerkelNode Data []byte }
func BuildMerkelNode ¶
func BuildMerkelNode(left, right *MerkelNode, data []byte) MerkelNode
type MerkelTree ¶
type MerkelTree struct {
MerkelRootNode *MerkelNode
}
func NewMerkelTree ¶
func NewMerkelTree(data [][]byte) *MerkelTree
Click to show internal directories.
Click to hide internal directories.