use big int for decimal IP rather than uint64

This commit is contained in:
rufo
2018-08-20 03:03:49 +01:00
parent a9c0587f87
commit 6d915d0f96
3 changed files with 18 additions and 12 deletions

View File

@ -27,12 +27,12 @@ func LookupPort(ip net.IP, port uint64) error {
return nil
}
func ToDecimal(ip net.IP) uint64 {
func ToDecimal(ip net.IP) *big.Int {
i := big.NewInt(0)
if to4 := ip.To4(); to4 != nil {
i.SetBytes(to4)
} else {
i.SetBytes(ip)
}
return i.Uint64()
return i
}