I have a database that stores the IP number of all users that have used a feature (ie: voted on a poll), and I want to avoid the same user or IP from voting twice.
As a result I have been storing all the IPs of the anonymous users that have voted on my polls. My database is filled with IPs like 123.456.789…
However, that is inefficient, is there a one way function that compresses and IP into a shorter string?
like 123.456.798 => %dA
For IPv4 you can compress an IP address into an
intlike this:This can be reversed too: