src/bosh-softlayer-cpi/softlayer/client/swift_large_object.go
func (lo *largeObject) md5Content(r io.ReadSeeker) (string, string, error) {
	// #nosec G401
	h := md5.New()
	mw := io.MultiWriter(h, lo.md5)
	if _, err := io.Copy(mw, r); err != nil {
		return "", "", err
	}
	sum := h.Sum(nil)
	hexSum := fmt.Sprintf("%x", sum)
	// add to checksum of all parts for verification on upload completion
	if _, err := lo.md5OfParts.Write(sum); err != nil {
		return "", "", err
	}
	return base64.StdEncoding.EncodeToString(sum), hexSum, nil
}
func (lo *largeObject) md5Content(r io.ReadSeeker) (string, string, error) {
	// #nosec G401
	h := md5.New()
	mw := io.MultiWriter(h, lo.md5)
	if _, err := io.Copy(mw, r); err != nil {
		return "", "", err
	}
	sum := h.Sum(nil)
	hexSum := fmt.Sprintf("%x", sum)
	// add to checksum of all parts for verification on upload completion
	if _, err := lo.md5OfParts.Write(sum); err != nil {
		return "", "", err
	}
	return base64.StdEncoding.EncodeToString(sum), hexSum, nil
}
func ( lo * largeObject ) md5Content ( r io . ReadSeeker ) ( string , string , error ) { // #nosec G401 h := md5 . New ( ) mw := io . MultiWriter ( h , lo . md5 ) if _ , err := io . Copy ( mw , r ) ; err != nil { return " " , " " , err } sum := h . Sum ( nil ) hexSum := fmt . Sprintf ( " " , sum ) // add to checksum of all parts for verification on upload completion if _ , err := lo . md5OfParts . Write ( sum ) ; err != nil { return " " , " " , err } return base64 . StdEncoding . EncodeToString ( sum ) , hexSum , nil }
// Md5 functions
Md5 functions