MCPcopy 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
30func 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

newResponseMethod · 0.92
TestToDecimalFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestToDecimalFunction · 0.68