func NewSha256Verifier(expected string) func(*os.File) error {
	return func(file *os.File) error {
		actual, _, err := utils.ReadSHA256(file)
		if err != nil {
			return errors.Trace(err)
		}
		if actual != expected {
			err := errors.Errorf("expected sha256 %q, got %q", expected, actual)
			return errors.NewNotValid(err, "")
		}
		return nil
	}
}
// NewSha256Verifier returns a verifier suitable for Request. The
// verifier checks the SHA-256 checksum of the file to ensure that it
// matches the one returned by the provided func.
NewSha256Verifier returns a verifier suitable for Request. The
verifier checks the SHA-256 checksum of the file to ensure that it
matches the one returned by the provided func.
// NewSha256Verifier returns a verifier suitable for Request . The // verifier checks the SHA - 256 checksum of the file to ensure that it // matches the one returned by the provided func .
func NewSha256Verifier(expected string) func(*os.File) error {
	return func(file *os.File) error {
		actual, _, err := utils.ReadSHA256(file)
		if err != nil {
			return errors.Trace(err)
		}
		if actual != expected {
			err := errors.Errorf("expected sha256 %q, got %q", expected, actual)
			return errors.NewNotValid(err, "")
		}
		return nil
	}
}
func NewSha256Verifier ( expected string ) func ( * os . File ) error { return func ( file * os . File ) error { actual , _ , err := utils . ReadSHA256 ( file ) if err != nil { return errors . Trace ( err ) } if actual != expected { err := errors . Errorf ( " " , expected , actual ) return errors . NewNotValid ( err , " " ) } return nil } }
NewSha256Verifier returns a verifier suitable for Request.
NewSha256Verifier returns a verifier suitable for Request .