Hacker News new | past | comments | ask | show | jobs | submit login




Not this time! =). But today's floppy equivalent is a micro-SD card.. Right? Right?


Wait, http://127.1/

In the browser in the crackberry video

what the....


It's a particularly cursed form of writing IPv4 addresses:

> A popular implementation of IP networking, originating in 4.2BSD, contains a function inet_aton() for converting IP addresses in character string representation to internal binary storage. In addition to the basic four-decimals format and 32-bit numbers, it also supported intermediate syntax forms of octet.24bits (e.g. 10.1234567; for Class A addresses) and octet.octet.16bits (e.g. 172.16.12345; for Class B addresses). It also allowed the numbers to be written in hexadecimal and octal representations, by prefixing them with 0x and 0, respectively. These features continue to be supported in some software, even though they are considered as non-standard.

(https://en.wikipedia.org/wiki/Dot-decimal_notation#IPv4_addr...)

Never use this.


I'm not sure it's "cursed", I find it useful shorthand and use it frequently.


127.1 is the same as 127.0.0.1. 0 bytes are inserted based on the following:

  x     -> 0.0.0.x
  x.y   -> x.0.0.y
  x.y.z -> x.y.0.z


But sometimes 127.1 means 127.1.0.0/16. For example in the output of `netstat -rn` on MacOS.


Good to know.

I was also coming back in to edit my comment and write that my x -> 0.0.0.x was technically wrong and the same for the others. If you stick to only single-byte values then what I wrote was correct but if the values span multiple bytes they fill in the missing 0s appropriately, as in:

  256   -> 0.0.1.0
  1.256 -> 1.0.1.0


Similar rules apply to ipv6 addresses as well.


IPv6 at least sensibly has a different delimiter for when you are eliding zeros.


It's not really about eliding zeros, though. It's kind of a cursed thing:

  x       -> x3.x2.x1.x0
  x.y     ->  x.y2.y1.y0
  x.y.z   ->  x. y.z1.z0
  x.y.z.w ->  x. y. z. w
Where x0 is the 8 least significant bits of x, x1 is the next 8 higher bits, and so on.

The "zeros" happen when the last number is smaller than 256 (or 65536, etc.), but it doesn't have to be. For example 10.258 is a valid way to write an IPv4 address, it's the same as 10.0.1.2.


Here's a cursed way of writing an ip address: 0xA.024.7720 where 0xA is hex, 024 is octal and last 2 octets are written as a decimal number


little known fact: you can write shorthand for any ip address. It simply omits 0. Ie 127.0.0.1 (or 127.000.000.001). Try pinging it. `ping 127.1`

10.0.0.3 -> ping 10.3


And the shortest IP to ping, for a quick connectivity check: 1.1 (1.0.0.1 is cloudflare dns alternate address)


what's the problem, there's a self hosted web server on it.

If you are talking about the short url, well ipv4 allows it and they needed to save space to fit on the floppy ;)




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

Search: