package engine import ( "crypto/sha256" "io/ioutil" ) // UniqueFileHash uses SHA256 to create a hash of the file func UniqueFileHash(src string) ([]byte, error) { file, err := ioutil.ReadFile(src) if err != nil { return []byte{}, err } hasher := sha256.New() hasher.Write(file) hash := hasher.Sum(nil) return hash, nil }