mirror of
https://github.com/danog/gllvm.git
synced 2025-01-23 05:51:18 +01:00
fix obj path hashing
This commit is contained in:
parent
b0014b15be
commit
dca2d7a30d
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user