func (g *CookieGenerator) NewToken(raddr net.Addr, origConnID protocol.ConnectionID) ([]byte, error) {
	data, err := asn1.Marshal(token{
		RemoteAddr:               encodeRemoteAddr(raddr),
		OriginalDestConnectionID: origConnID,
		Timestamp:                time.Now().Unix(),
	})
	if err != nil {
		return nil, err
	}
	return g.cookieProtector.NewToken(data)
}
NewToken generates a new Cookie for a given source address
package handshake
import (
	"encoding/asn1"
	"fmt"
	"net"
	"time"
	"github.com/lucas-clemente/quic-go/internal/protocol"
)
const (
	cookiePrefixIP byte = iota
	cookiePrefixString
)
type Cookie struct {
	RemoteAddr               string
	OriginalDestConnectionID protocol.ConnectionID
	SentTime time.Time
}
type token struct {
	RemoteAddr               []byte
	OriginalDestConnectionID []byte
	Timestamp int64
}
type CookieGenerator struct {
	cookieProtector cookieProtector
}
func NewCookieGenerator() (*CookieGenerator, error) {
	cookieProtector, err := newCookieProtector()
	if err != nil {
		return nil, err
	}
	return &CookieGenerator{
		cookieProtector: cookieProtector,
	}, nil
}