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: checksum.go
    path of file: ./repos/sliver/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc4757
    
    the code of the file until where you have to start completion: package rfc4757

import (
	"bytes"
	"crypto/hmac"
	"crypto/md5"
	"io"
)

// Checksum returns a hash of the data in accordance with RFC 4757
func Checksum(key []byte, usage uint32, data []byte) ([]byte, error) {
	// Create hashing key
	s := append([]byte(`signaturekey`), byte(0x00)) //includes zero octet at end
	mac := hmac.New(md5.New, key)
	mac.Write(s)
	Ksign := mac.Sum(nil)

	// Format data
	t
    
func Checksum(key []byte, usage uint32, data []byte) ([]byte, error) {
	// Create hashing key
	s := append([]byte(`signaturekey`), byte(0x00)) //includes zero octet at end
	mac := hmac.New(md5.New, key)
	mac.Write(s)
	Ksign := mac.Sum(nil)

	// Format data
	tb := UsageToMSMsgType(usage)
	p := append(tb, data...)
	h := md5.New()
	rb := bytes.NewReader(p)
	_, err := io.Copy(h, rb)
	if err != nil {
		return []byte{}, err
	}
	tmp := h.Sum(nil)

	// Generate HMAC
	mac = hmac.New(md5.New, Ksign)
	mac.Write(tmp)
	return mac.Sum(nil), nil
}