
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
This is a simple Python library for anonymizing IP addresses. Both IPv4 and IPv6 addresses are supported.
Examples:
95.239.169.11
→ 95.239.169.0
5219:3a94:fdc5:19e1:70a3:b2c4:40ef:ae03
→ 5219:3a94:fdc5:19e1::
pip install anonymizeip
from anonymizeip import anonymize_ip
address = "fe80::0202:b3ff:fe1e:8329"
anonymized = anonymize_ip(address)
print(anonymized)
# Prints "fe80::"
The number of address blocks that are set to 0 can be customized.
Besides the IP address, the function anonymize_ip
takes two optional parameters:
anonymize_ip(
address,
ipv4_mask="...",
ipv6_mask="..."
)
ipv4_mask
: Defaults to 255.255.255.0
, i.e. the last octet will be anonymized (set to 0)ipv6_mask
: Defaults to ffff:ffff:ffff:ffff::
(same as ffff:ffff:ffff:ffff:0:0:0:0
), i.e. the last four blocks will be anonymized (set to 0)git clone
pipenv install --dev
pipenv run test
pipenv run lint
Contributions are always welcome. Please first discuss changes via issue before submitting a pull request.
The implementation of this library was strongly inspired by php-ip-anonymizer by Geert Wirken.
FAQs
Python library for anonymizing IP addresses
We found that anonymizeip demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.