Guest User

Untitled

a guest
Jul 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. ```
  2. func InetNtoA(ip int64) string {
  3. return fmt.Sprintf("%d.%d.%d.%d",
  4. byte(ip>>24), byte(ip>>16), byte(ip>>8), byte(ip))
  5. }
  6.  
  7. func InetAtoN(ip string) int64 {
  8. ret := big.NewInt(0)
  9. ret.SetBytes(net.ParseIP(ip).To4())
  10. return ret.Int64()
  11. }
  12. ```
Add Comment
Please, Sign In to add comment