Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

IP addresses are 4 bytes, each in the range 0-255. In binary bits xyz would be equivalent to decimal x2^2+y2+z. Similarly, bytes abc would be equivalent to decimal a256^2+b256+c.

IP address p.q.r.s is decimal p256^3+q256^2+r*256+s.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: