func GenerateFingerprint(reader io.Reader, newHash func() hash.Hash) (Fingerprint, error) {
	var fp Fingerprint

	if reader == nil {
		return fp, errors.New("missing reader")
	}
	if newHash == nil {
		return fp, errors.New("missing new hash func")
	}

	hash := newHash()
	if _, err := io.Copy(hash, reader); err != nil {
		return fp, errors.Trace(err)
	}
	fp.sum = hash.Sum(nil)
	return fp, nil
}
// GenerateFingerprint returns the fingerprint for the provided data.
GenerateFingerprint returns the fingerprint for the provided data.
// GenerateFingerprint returns the fingerprint for the provided data .
func GenerateFingerprint(reader io.Reader, newHash func() hash.Hash) (Fingerprint, error) {
	var fp Fingerprint
	if reader == nil {
		return fp, errors.New("missing reader")
	}
	if newHash == nil {
		return fp, errors.New("missing new hash func")
	}
	hash := newHash()
	if _, err := io.Copy(hash, reader); err != nil {
		return fp, errors.Trace(err)
	}
	fp.sum = hash.Sum(nil)
	return fp, nil
}
func GenerateFingerprint ( reader io . Reader , newHash func ( ) hash . Hash ) ( Fingerprint , error ) { var fp Fingerprint if reader == nil { return fp , errors . New ( " " ) } if newHash == nil { return fp , errors . New ( " " ) } hash := newHash ( ) if _ , err := io . Copy ( hash , reader ) ; err != nil { return fp , errors . Trace ( err ) } fp . sum = hash . Sum ( nil ) return fp , nil }
GenerateFingerprint returns the fingerprint for the provided data.
GenerateFingerprint returns the fingerprint for the provided data .