func PacketHash(data []byte) []byte {
	sum := sha256.Sum256(data)
	return sum[:]
}
PacketHash returns the hash of a packet
package server
import (
	"crypto/sha256"
	"net"
	"github.com/iotaledger/hive.go/identity"
	"google.golang.org/protobuf/proto"
)
const (
	MaxPacketSize = 1280
)
type MType uint32
type Message interface {
	proto.Message
	Type() MType
}
type Sender interface {
	Send(toAddr *net.UDPAddr, data []byte)
	SendExpectingReply(toAddr *net.UDPAddr, toID identity.ID, data []byte, replyType MType, callback func(Message) bool) <-chan error
}
type Handler interface {
	HandleMessage(s *Server, fromAddr *net.UDPAddr, from *identity.Identity, data []byte) (bool, error)
}
type HandlerFunc func(*Server, *net.UDPAddr, *identity.Identity, []byte) (bool, error)
func (f HandlerFunc) HandleMessage(s *Server, fromAddr *net.UDPAddr, from *identity.Identity, data []byte) (bool, error) {
	return f(s, fromAddr, from, data)
}