Disclaimer:
These pages about different languages / apis / best practices were mostly jotted down quckily and rarely corrected afterwards.
The languages / apis / best practices may have changed over time (e.g. the facebook api being a prime example), so what was documented as a good way to do something at the time might be outdated when you read it (some pages here are over 15 years old).
Just as a reminder.

Converting an IP into a single number and back again

converts ip addresses

See also how to hex a domain.

Mindworkshop has got some basic info on how to trace spammers.
One thing they got is how to trace spammers that has got a url looking weird, like http://3637542882 for example.
I made a javascript to calculate a url like that into a proper IP.

Some spam generators like to express their URLs as somewhat impenetrable-looking numbers, such as http://3637542882. This looks a bit daunting, as it's not a domain and it's not an IP address. At least, it doesn't seem to be one.

In fact, those long numbers are IP addresses � they're just expressed in a way intended to make them hard to work with. You can create one by treating the four sections of an IP address as four distinct numbers. The IP address for the Alchemy Mindworks web server, for example, is 216.208.127.226. Here's how to convert this address into a quasi-meaningless string of numbers: 216 � 16,777,216 + 208 � 65536 + 127 � 256 + 226

The formula is:

 A=floor (NUMBER/16,777,216)
 NUMBER=(NUMBER - (A * 16,777,216) )
 B=floor (NUMBER/65536)
 NUMBER=(NUMBER - (B * 65536  ) )
 C= floor (NUMBER/256)
 D=(NUMBER - (C * 65536  ) )
 
Where the ip is A.B.C.D

Use this javascript to calculate it automatically:

Enter number:

IP:


And to calculate the other way around (e.g. get a magic number from an IP):
Enter IP: ...

IP:


More programming related pages

Workflow: Release process
Workflow: Bug tracking
Teambox (Redbooth) - Mantis connector
Design Patterns
Git & Github
Go / Golang
CVS
CVS backup script
Distribution process
Installation script
Java Server Faces
Facelets
jibx
jBoss
jBpm
Perl tips
Perl links
PostgreSQL
Python / py2app
Shell scripts
Xslt
Node.js
Facebook / Opengraph
PHP developer notes
Redbooth API through php
Website optimization
jqTableKit demo
Javascript / html / css links