fix: checksum, ipv6 and domain matching problem

This commit is contained in:
mzz2017
2023-01-30 17:31:42 +08:00
parent 2de1a73dd2
commit 2105b5108b
6 changed files with 33 additions and 24 deletions

View File

@ -42,6 +42,13 @@ func Ipv6ByteSliceToUint32Array(_ip []byte) (ip [4]uint32) {
return ip
}
func Ipv6Uint32ArrayToByteSlice(_ip [4]uint32) (ip []byte) {
for j := 0; j < 4; j++ {
ip = binary.LittleEndian.AppendUint32(ip, _ip[j])
}
return ip
}
func Deduplicate(list []string) []string {
res := make([]string, 0, len(list))
m := make(map[string]struct{})