MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / IsIPv6

Function IsIPv6

internal/utils/ip.go:48–54  ·  view source on GitHub ↗

IsIPv6 是否为IPv6

(ip string)

Source from the content-addressed store, hash-verified

46
47// IsIPv6 是否为IPv6
48func IsIPv6(ip string) bool {
49 var data = net.ParseIP(ip)
50 if data == nil {
51 return false
52 }
53 return !IsIPv4(ip)
54}
55
56// IsWildIP 宽泛地判断一个数据是否为IP
57func IsWildIP(v string) bool {

Callers 3

TestIsIPv6Function · 0.92
runActionSingleIPMethod · 0.92
updateAllowIPListMethod · 0.92

Calls 2

IsIPv4Function · 0.85
ParseIPMethod · 0.80

Tested by 1

TestIsIPv6Function · 0.74