Message Boards Message Boards

HipkuWL: encode any IP address as a unique haiku with Wolfram Language

Posted 8 years ago

Click on the image to go directly to the app. Read how it works below, or clone the code on GitHub.

enter image description here

Gabriel Martin released Hipku, an algorithm for encoding an IP address to a unique haiku, and vice versa in December 2014.

For example,

hipkuEncode["127.0.0.1"]

will always produce

 The hungry white ape
 aches in the ancient canyon.
 Autumn colors crunch.

And the same is true in reverse.

The scheme works for both ipv4 and ipv6 addresses, and although the choice of vocabulary is arbitrary, the relative identity of the words must remain the same.

The code itself is unremarkable, and relies on the magic of modular arithmetic. For now I only have the encoding part done. At some later date I may write the decoding code, but to me that is less interesting (and less poetic!).

Gabriel Martin's version was written in Javascript, and other language implementations have since been released. Attached is my WL implementation which is similar to Gabriel's, but in some ways more simple due to the differences in programming environments. As usual, the Wolfram Language really shines when the need to compute something mathematical arises. QuotientRemainder[], anyone? I especially encourage readers to compare my factoring code with the original.

Additionally, note the ease with which the algorithm is immediately made available as a validating web form, via FormPage[].

In closing, I am intrigued by the thought of a world in which the designers of the Web, in dramatic flair, had used poems rather than 32-bit (and later 128-bit) integers for addressing.

As Hipku demonstrates, "poem addresses" (PoemDresses?) work, at least in theory. Although they would have been much less efficient for computers, arguably they would have made Internet addressing easier (and more compelling) for humans.

Attachments:
POSTED BY: Noah Tilton
2 Replies

Mine comes out as:

The drowsy brown crow
runs in the serene clearing.
Yellowwood leaves fall.

POSTED BY: Kathryn Cramer

enter image description here - you have earned "Featured Contributor" badge, congratulations !

This is a great post and it has been selected for the curated Staff Picks group. Your profile is now distinguished by a "Featured Contributor" badge and displayed on the "Featured Contributor" board.

POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract