Keksdose.IpParser (keksdose v0.4.1)

Copy Markdown View Source

Server-side anonymization of remote IPs.

IPv4 → drops the final octet (e.g. 192.168.1.42192.168.1.0). IPv6 → preserves the /48 prefix and zeroes the remaining 80 bits

   (e.g. `2001:db8:1:2:3:4:5:6`  `2001:db8:1::`).

Anything unparseable → "0.0.0.0".

Summary

Functions

Mask a remote IP given either an :inet tuple or a string.

Functions

mask_ip(ip)

Mask a remote IP given either an :inet tuple or a string.