MCPcopy Create free account
hub / github.com/HashLoad/boss / HashDir

Function HashDir

utils/hash.go:19–37  ·  view source on GitHub ↗
(dir string)

Source from the content-addressed store, hash-verified

17}
18
19func HashDir(dir string) string {
20 var err error
21 var finHash = "b:"
22 err = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
23 if err != nil {
24 return nil
25 }
26 fileBytes, _ := ioutil.ReadFile(path)
27 fileHash := hashByte(&fileBytes)
28 finHash += fileHash
29 return nil
30 })
31 if err != nil {
32 os.Exit(1)
33 }
34 c := []byte(finHash)
35 m := hashByte(&c)
36 return m
37}

Callers 3

AddInstalledMethod · 0.92
internalNeedUpdateMethod · 0.92
SetInstalledMethod · 0.92

Calls 1

hashByteFunction · 0.85

Tested by

no test coverage detected