code: func messageMAC(signature string) ([]byte, func() hash.Hash, error) {
  	if signature == "" {
  		return nil, nil, errors.New("missing signature")
  	}
  	sigParts := strings.SplitN(signature, "=", 2)
  	if len(sigParts) != 2 {
  		return nil, nil, fmt.Errorf("error parsing signature %q", signature)
  	}
  
  	var hashFunc func() hash.Hash
  	switch sigParts[0] {
  	case sha1Prefix:
  		hashFunc = sha1.New
  	case sha256Prefix:
  		hashFunc = sha256.New
  	case sha512Prefix:
  		hashFunc = sha512.New
  	default:
  		return nil, nil, fmt.Errorf("unknown hash type prefix: %q", sigParts[0])
  	}
  
  	buf, err := hex.DecodeString(sigParts[1])
  	if err != nil {
  		return nil, nil, fmt.Errorf("error decoding signature %q: %v", signature, err)
  	}
  	return buf, hashFunc, nil
  }
docs: // messageMAC returns the hex-decoded HMAC tag from the signature and its
  // corresponding hash function.