PHP » GoLang |
login |
register |
about
|
sha1_filesha1_file[code] func Sha1File(path string) (string, error) { data, err := ioutil.ReadFile(path) if err != nil { return "", err } hash := sha1.New() hash.Write([]byte(data)) return hex.EncodeToString(hash.Sum(nil)), nil } [/code] |