Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var HasherFactory = HasherFactoryMap{ intoto.AlgorithmMD5: md5.New, intoto.AlgorithmSHA1: sha1.New, intoto.AlgorithmSHA224: crypto.SHA224.New, intoto.AlgorithmSHA512_224: crypto.SHA512_224.New, intoto.AlgorithmSHA256: sha256.New, intoto.AlgorithmSHA512_256: crypto.SHA512_256.New, intoto.AlgorithmSHA384: crypto.SHA384.New, intoto.AlgorithmSHA512: crypto.SHA512.New, intoto.AlgorithmSHA3_224: crypto.SHA3_224.New, intoto.AlgorithmSHA3_256: crypto.SHA3_256.New, intoto.AlgorithmSHA3_384: crypto.SHA384.New, intoto.AlgorithmSHA3_512: sha3.New512, intoto.AlgorithmGitBlob: sha1.New, intoto.AlgorithmGitCommit: sha1.New, intoto.AlgorithmGitTag: sha1.New, intoto.AlgorithmGitTree: sha1.New, intoto.AlgorithmDirHash: sha1.New, }
HasherFactory is a preconfigured hasher map with all the known algorithm types
Functions ¶
This section is empty.
Types ¶
type FileHashSet ¶
FileHashSet captures a set of hashes of the same artifact indexed by its path.
func (*FileHashSet) ToResourceDescriptors ¶
func (fhs *FileHashSet) ToResourceDescriptors() []*intoto.ResourceDescriptor
type HashSet ¶
type HashSet map[intoto.HashAlgorithm]string
HashSet captures a set of hashes of the same artifact.
func NewHashSet ¶ added in v0.2.1
NewHashSet returns a new hashset from any map of string-like things
func (*HashSet) ToResourceDescriptor ¶
func (hs *HashSet) ToResourceDescriptor() *intoto.ResourceDescriptor
type HashSetList ¶
type HashSetList []HashSet
HashSetList is an array of HashSets.
func (*HashSetList) ToResourceDescriptors ¶
func (hsl *HashSetList) ToResourceDescriptors() []*intoto.ResourceDescriptor
type Hasher ¶
type Hasher struct {
Options Options
}
Hasher is an object that has methods to hash data.
func (*Hasher) HashFiles ¶
func (h *Hasher) HashFiles(paths []string) (*FileHashSet, error)
HashFiles gets a list of paths and returns the file hashes indexed by path name. The results are guaranteed to be in the same order but any repeated paths will be hashed more than once and included only once in the returned structure.
func (*Hasher) HashReaders ¶
func (h *Hasher) HashReaders(readers []io.Reader) (*HashSetList, error)
HashFiles takes a list of files and returns the hashes for them
type HasherFactoryMap ¶
type HasherFactoryMap map[intoto.HashAlgorithm]func() hash.Hash
HasherFactoryMap is a map that can create hash.Hash objects for all the recognized algorithm types.
func (*HasherFactoryMap) GetHasher ¶
func (hf *HasherFactoryMap) GetHasher(algo intoto.HashAlgorithm) hash.Hash
type OptFn ¶ added in v0.2.0
func WithAlgorithms ¶ added in v0.2.0
type Options ¶
type Options struct { Algorithms []intoto.HashAlgorithm MaxParallel int }