mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-02-24 13:12:26 +08:00
fix uuid match
This commit is contained in:
parent
b3295262c1
commit
a08e39faec
@ -7,10 +7,11 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"net"
|
"net"
|
||||||
"regexp"
|
|
||||||
|
|
||||||
"github.com/Dreamacro/clash/component/dialer"
|
"github.com/Dreamacro/clash/component/dialer"
|
||||||
C "github.com/Dreamacro/clash/constant"
|
C "github.com/Dreamacro/clash/constant"
|
||||||
|
|
||||||
|
"github.com/gofrs/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Base struct {
|
type Base struct {
|
||||||
@ -151,8 +152,8 @@ func newPacketConn(pc net.PacketConn, a C.ProxyAdapter) C.PacketConn {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func uuidMap(str string) string {
|
func uuidMap(str string) string {
|
||||||
match, _ := regexp.MatchString(`[\da-f]{8}(-[\da-f]{4}){3}-[\da-f]{12}$`, str)
|
_, err := uuid.FromString(str)
|
||||||
if !match {
|
if err != nil {
|
||||||
var Nil [16]byte
|
var Nil [16]byte
|
||||||
h := sha1.New()
|
h := sha1.New()
|
||||||
h.Write(Nil[:])
|
h.Write(Nil[:])
|
||||||
|
Loading…
Reference in New Issue
Block a user