mirror of
https://github.com/mpolden/echoip.git
synced 2025-07-17 14:33:30 +02:00
use big int for decimal IP rather than uint64
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user