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
584 B

package merkle
type Tree interface {
Size() (size int)
Height() (height int8)
Has(key interface{}) (has bool)
Get(key interface{}) (index int, value interface{})
GetByIndex(index int) (key interface{}, value interface{})
Set(key interface{}, value interface{}) (updated bool)
Remove(key interface{}) (value interface{}, removed bool)
HashWithCount() (hash []byte, count int)
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
}