| 1234567891011121314151617181920212223242526272829303132 | package helperimport (	"crypto/sha512"	"fmt"	"github.com/uozi-tech/cosy/logger"	"io"	"os")func DigestSHA512(filepath string) (hashString string) {	file, err := os.Open(filepath)	if err != nil {		logger.Error(err)		return	}	defer file.Close()	hash := sha512.New()	_, err = io.Copy(hash, file)	if err != nil {		logger.Error(err)		return	}	hashValue := hash.Sum(nil)	hashString = fmt.Sprintf("%x", hashValue)	return}
 |