Skip to content

Commit

Permalink
refactor: #HasHashLength(hash.Hash) to #HasDigestSize(int)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite committed Jul 16, 2024
1 parent 958f534 commit 934fc19
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package smt
import (
"encoding/binary"
"fmt"
"hash"
)

// MustSum returns the uint64 sum of the merkle root, it checks the length of the
Expand Down Expand Up @@ -52,10 +51,10 @@ func (root MerkleSumRoot) Count() (uint64, error) {
return root.count(), nil
}

// HasHashLength returns true if the root hash (digest) length is the same as
// HasDigestSize returns true if the root hash (digest) length is the same as
// that of the size of the given hasher.
func (root MerkleSumRoot) HasHashLength(hasher hash.Hash) bool {
return root.length() == hasher.Size()
func (root MerkleSumRoot) HasDigestSize(size int) bool {
return root.length() == size
}

// validateBasic returns an error if the root (digest) length is not a power of two.
Expand Down

0 comments on commit 934fc19

Please sign in to comment.