Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/mpolden/echoip
/ ToDecimal
Function
ToDecimal
iputil/iputil.go:30–38 ·
view source on GitHub ↗
(ip net.IP)
Source
from the content-addressed store, hash-verified
28
}
29
30
func
ToDecimal(ip net.IP) *big.Int {
31
i := big.NewInt(0)
32
if
to4 := ip.To4(); to4 != nil {
33
i.SetBytes(to4)
34
}
else
{
35
i.SetBytes(ip)
36
}
37
return
i
38
}
Callers
2
newResponse
Method · 0.92
TestToDecimal
Function · 0.85
Calls
no outgoing calls
Tested by
1
TestToDecimal
Function · 0.68