Documentation ¶
Index ¶
- func DrawTree(ms TraversableMapStore, root []byte, options DrawTreeOptions) (*graphviz.Graphviz, *cgraph.Graph, error)
- func FindLogs(input string) []*loglist2.Log
- func GetLogList() *loglist2.LogList
- func HashBytes(bs ...[]byte) []byte
- func HashBytesFixed(bs ...[]byte) ct.SHA256Hash
- func NewTruncatedSHA256(size int) hash.Hash
- func NormalizeDomainName(rawName string) (string, error)
- func RandomBase64String(length int) string
- func TruncateHash(base hash.Hash, size int) hash.Hash
- type DrawTreeOptions
- type TraversableMapStore
- type TruncatedHash
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DrawTree ¶
func DrawTree(ms TraversableMapStore, root []byte, options DrawTreeOptions) (*graphviz.Graphviz, *cgraph.Graph, error)
DrawTree draws a graphviz tree starting at the given root.
func FindLogs ¶
FindLogs is similar to loglist2.LogList.FuzzyFindLog, but also tries to use search by strings.lower(input) in the case of URLs.
func GetLogList ¶
GetLogList returns a fixed log list that is loaded from an embeded file. The returned loglist is the same throughout the runtime of the program and should therefore not be modified.
func HashBytesFixed ¶
func HashBytesFixed(bs ...[]byte) ct.SHA256Hash
HashBytesFixed returns the sha256 hash of the given bytes in a fixed size array
func NewTruncatedSHA256 ¶
NewTruncatedSHA256 creates a new TruncatedHash using sha256 as its base hash. Equivalent to calling TruncateHash(sha256.New(), size).
func NormalizeDomainName ¶
NormalizeDomainName puts a domain name in normalized form
func RandomBase64String ¶
RandomBase64String creates a random base64 string of the specified length.
Types ¶
type DrawTreeOptions ¶
type DrawTreeOptions struct { MaxHashLength int FormatHashesAsHex bool ValueFormatter func(leafPath, leafHash, valueHash, value []byte) string }
DrawTreeOptions is used to specify options to DrawTree
type TraversableMapStore ¶
type TraversableMapStore interface { smt.MapStore TraverseNodes(root []byte, nodeFn mapstore.NodeHandler, leafFn mapstore.LeafHandler) error }
A TraversableMapStore is a map store which can be traversed.
func MapStoreFromLeaves ¶
func MapStoreFromLeaves(leaves []uint64) (TraversableMapStore, []byte)
MapStoreFromLeaves creates a traversable map store from a slice of leaves. This MapStore is extremely limited an supports only traversal and Get(n) of leaf values.
Returns the map store and the root node
type TruncatedHash ¶
type TruncatedHash struct {
// contains filtered or unexported fields
}
A TruncatedHash is a truncated version of longer hashes. Used for testing purposes
func (*TruncatedHash) BlockSize ¶
func (sh *TruncatedHash) BlockSize() int
BlockSize returns the hash's underlying block size. The Write method must be able to accept any amount of data, but it may operate more efficiently if all writes are a multiple of the block size.
func (*TruncatedHash) Reset ¶
func (sh *TruncatedHash) Reset()
Reset resets the Hash to its initial state.
func (*TruncatedHash) Size ¶
func (sh *TruncatedHash) Size() int
Size returns the number of bytes Sum will return.
func (*TruncatedHash) Sum ¶
func (sh *TruncatedHash) Sum(b []byte) []byte
Sum appends the current hash to b and returns the resulting slice. It does not change the underlying hash state.