You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

21 lines
597 B

package merkle
type Tree interface {
Size() (size uint64)
Height() (height uint8)
Has(key interface{}) (has bool)
Get(key interface{}) (index uint64, value interface{})
GetByIndex(index uint64) (key interface{}, value interface{})
Set(key interface{}, value interface{}) (updated bool)
Remove(key interface{}) (value interface{}, removed bool)
HashWithCount() (hash []byte, count uint64)
Hash() (hash []byte)
Save() (hash []byte)
Load(hash []byte)
Copy() Tree
Iterate(func(key interface{}, value interface{}) (stop bool)) (stopped bool)
}
type Hashable interface {
Hash() []byte
}