extract an HTML helper method to convert an ip address into an id