MCPcopy
hub / github.com/minio/minio-go / checkCRC

Function checkCRC

api-select.go:745–755  ·  view source on GitHub ↗

checkCRC ensures that the CRC matches with the one from the reader.

(r io.Reader, expect uint32)

Source from the content-addressed store, hash-verified

743
744// checkCRC ensures that the CRC matches with the one from the reader.
745func checkCRC(r io.Reader, expect uint32) error {
746 msgCRC, err := extractUint32(r)
747 if err != nil {
748 return err
749 }
750
751 if msgCRC != expect {
752 return fmt.Errorf("Checksum Mismatch, MessageCRC of 0x%X does not equal expected CRC of 0x%X", msgCRC, expect)
753 }
754 return nil
755}

Callers 2

startMethod · 0.85
processPreludeFunction · 0.85

Calls 1

extractUint32Function · 0.85

Tested by

no test coverage detected