by dec0dedab0de · 8y ago · 0 comments
like http://3520653040 should take you to hn (atleast to the IP I'm resolving for hn right now)
Also, I know this is off topic, but that python example really bothered me.
original:
python -c 'import sys;print sys.argv[1].decode("utf-8").encode("idna")' "℡"
Should have been python -c 'print "℡".decode("utf-8").encode("idna")'
Or in python3 python -c 'print( "℡".encode("idna"))'https://raymii.org/s/articles/IPv4_Address_Conversion_Tricks...
This "feature" is documented in the inet_aton(3) manpage.
More seriously, I just copied that codefrom somewhere. Why is the other way better?
Shorten? More readable? Simpler? Surely you said that in jest.
3520653040 = 209 * 256^3 + 216 * 256^2 + 230 * 256^1 + 240 * 256^0
The 209.216.230.240 representation is the sequence of octets (256 = 2^8) from MSB to LSB expressed as decimal values.