You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ipv4.go
    path of file: ./repos/fq/pkg/checksum
    
    the code of the file until where you have to start completion: package checksum

// IPv4 implements hash.Hash
type IPv4 struct {
	sum uint
	odd bool
}

func (c *IPv4) Writ
    
func (c *IPv4) Write(p []byte) (n int, err error) {
	for _, b := range p {
		if c.odd {
			c.sum += uint(b)
			if c.sum > 0xffff {
				c.sum++
				c.sum &= 0xffff
			}
		} else {
			c.sum += uint(b) << 8
		}
		c.odd = !c.odd
	}
	return len(p), nil
}