MCPcopy
hub / github.com/segmentio/kafka-go / crc32

Method crc32

message.go:72–82  ·  view source on GitHub ↗
(cw *crc32Writer)

Source from the content-addressed store, hash-verified

70}
71
72func (m message) crc32(cw *crc32Writer) int32 {
73 cw.crc32 = 0
74 cw.writeInt8(m.MagicByte)
75 cw.writeInt8(m.Attributes)
76 if m.MagicByte != 0 {
77 cw.writeInt64(m.Timestamp)
78 }
79 cw.writeBytes(m.Key)
80 cw.writeBytes(m.Value)
81 return int32(cw.crc32)
82}
83
84func (m message) size() int32 {
85 size := 4 + 1 + 1 + sizeofBytes(m.Key) + sizeofBytes(m.Value)

Callers 3

TestMessageCRC32Function · 0.95
messageMethod · 0.95

Calls 3

writeInt8Method · 0.45
writeInt64Method · 0.45
writeBytesMethod · 0.45

Tested by 2

TestMessageCRC32Function · 0.76