package
Version:
v0.0.0-...-3ccdb94
Opens a new window with list of versions in this module.
Published: Jan 6, 2024
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Hash computes the SHA-256 hash of input data
func HashPair(hash1, hash2 [32]byte) [32]byte
type File struct {
Data string
}
type MerkleTree struct {
Root *Node
Leaves []*Node
}
BuildMerkleTree constructs a Merkle tree from the given files
Update updates the data at the specified index and recalculates the necessary hashes.
GetSibling returns the sibling of the node. If the node is a left child, return the right child and vice versa.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.