INNER CODE UNIT · Go

fileSHA256

uvwt/agentdock · tools/release/main.go:63

func fileSHA256(path string) (string, error) {
	file, err := os.Open(path)
	if err != nil {
		return "", err
	}
	defer file.Close()
	hasher := sha256.New()
	if _, err := io.Copy(hasher, file); err != nil {
		return "", err
	}
	return hex.EncodeToString(hasher.Sum(nil)), nil
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…