fix obj path hashing

This commit is contained in:
Loic Gelle 2017-06-22 16:09:04 -07:00
parent b0014b15be
commit dca2d7a30d

View File

@ -8,6 +8,7 @@ import(
"path/filepath"
"strings"
"crypto/sha256"
"encoding/base64"
)
type ParserResult struct {
@ -242,8 +243,10 @@ func getArtifactNames(pr ParserResult, srcFileIndex int, hidden bool) (objBase s
// Return a hash for the absolute object path
func getHashedPath(path string) string {
inputBytes := []byte(path)
hash := sha256.Sum256(inputBytes)
return string(hash[:])
hasher := sha256.New()
hasher.Write(inputBytes)
hash := base64.URLEncoding.EncodeToString(hasher.Sum(nil))
return hash
}
func (pr *ParserResult) inputFileCallback(flag string, _ []string) {