func GenerateCSeq() int {
	return rand.Int() % 50000
}
Generate a secure random number between 0 and 50,000.
package util
import (
	"encoding/hex"
	"math/rand"
	"net"
	"strconv"
	"strings"
	"syscall"
)
func IsRefused(err error) bool {
	operr, ok := err.(*net.OpError)
	return ok && operr.Err == syscall.ECONNREFUSED
}
func IsUseOfClosed(err error) bool {
	return strings.Contains(err.Error(), "use of closed network connection")
}
func IsIPv6(ip string) bool {
	return strings.Index(ip, ":") >= 0
}