Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```
- func InetNtoA(ip int64) string {
- return fmt.Sprintf("%d.%d.%d.%d",
- byte(ip>>24), byte(ip>>16), byte(ip>>8), byte(ip))
- }
- func InetAtoN(ip string) int64 {
- ret := big.NewInt(0)
- ret.SetBytes(net.ParseIP(ip).To4())
- return ret.Int64()
- }
- ```
Add Comment
Please, Sign In to add comment