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

It's an IPv4 address expressed as a 4-byte integer instead of four separate decimal octets. 172.217.23.110 is an IP belonging to Google.

172<<24 + 217<<16 + 23<<8 + 110 = 2899908462




This is also why 1.1 === 1.0.0.1

Saves 4 whole keystrokes if you quickly want to ping something to test connectivity.


In the 90s there was a campaign about the new worldwide 10-digit phone number format.

So if you own some 31.x block, you could have a phone number which matches your IP.


Worldwide 10 digit format? News to me. Can you say more?


There was a campaign that went something like "de hele wereld bellen, even tot tien bellen"

I think I'm wrong, it was about the 10-digit Dutch numbers.

https://www.youtube.com/watch?v=NfcD3RiB1EA



Has it been implemented by any carriers?

The US phone system had such a service for a few years (area code 500 iirc). It had so little uptake that it was shut down.


I wrote this a number of years ago to accomplish same:

    #!/bin/ksh                                                                                                                                                                                                     
                                                                                                                                                                                                                   
    Die() {                                                                                                                                                                                                        
        echo Bad IP                                                                                                                                                                                                
        exit 1                                                                                                                                                                                                     
    }                                                                                                                                                                                                              
                                                                                                                                                                                                                   
    [ $# = 1 ] || Die                                                                                                                                                                                              
                                                                                                                                                                                                                   
    [ ${1%%?*.?*.?*.?*} ] && Die                                                                                                                                                                                   
                                                                                                                                                                                                                   
    I=$1                                                                                                                                                                                                           
                                                                                                                                                                                                                   
    until [ ${#I} = 0 ]                                                                                                                                                                                            
    do                                                                                                                                                                                                             
        J=${I#[0-9.]}                                                                                                                                                                                              
        [ ${#I} = ${#J} ] && Die                                                                                                                                                                                   
        I=$J                                                                                                                                                                                                       
    done                                                                                                                                                                                                           
                                                                                                                                                                                                                   
    I=$1.                                                                                                                                                                                                          
                                                                                                                                                                                                                   
    typeset -ui N=0                                                                                                                                                                                                
                                                                                                                                                                                                                   
    while [ $I ]                                                                                                                                                                                                   
    do                                                                                                                                                                                                             
        J=${I%%.*}                                                                                                                                                                                                 
        I=${I#$J.}                                                                                                                                                                                                 
        [ $((J>>8)) = 0 ] || Die                                                                                                                                                                                   
        N=$(( (N<<8) + J ))                                                                                                                                                                                        
    done                                                                                                                                                                                                           
                                                                                                                                                                                                                   
    echo $N                                                                                                                                                                                                        
                                                                                                                                                                                                                   
    # End




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

Search: