Release: Version 2.0.0
Released on: 2024-11-20
Changes Introduced:
- IPv6 Integration: Extended the script to handle both IPv4 and IPv6 prefixes, allowing for comprehensive IP range processing.
- Separate Processing Pipelines: Implemented distinct processing logic for IPv4 and IPv6 ranges to optimize performance and maintain clarity.
- Range Merging and Sorting: Added functionality to merge and sort cloud IP ranges upfront, reducing redundancy and enhancing subtraction efficiency.
- Optimized Bitwise Operations: Improved bitwise operations, especially for BCMath, to minimize computational overhead and speed up processing.
- Enhanced Functionality:
- Updated IP conversion functions to support IPv6 addresses using
inet_pton
andinet_ntop
. - Refactored CIDR to range and range to CIDR conversion functions to accommodate IPv6 addressing.
- Updated IP conversion functions to support IPv6 addresses using
- Performance Optimizations: Streamlined loops and minimized redundant calculations to achieve faster execution times without altering output.
- Comprehensive Documentation: Updated script comments and documentation to reflect IPv6 support and the associated changes in functionality.
- Composer Dependencies: Updated
composer.json
to include dependencies for PHP extensions GMP and BCMath, along with scripts to enforce their presence.
Impact:
- Extended Compatibility: Users can now utilize the script for environments requiring IPv6 alongside IPv4, ensuring broader applicability.
- Improved Efficiency: Performance optimizations lead to quicker processing times, especially when dealing with large sets of IP ranges.
- Maintainability: Clear separation of IPv4 and IPv6 logic enhances code readability and ease of future maintenance.
Performance Improvements:
- Execution Speed: The script now executes in under 500ms with GMP Ext installed on our test server, a significant improvement from the original Python script's 1.5 seconds for the same task. This enhancement ensures faster IP range calculations, making the script more efficient and responsive.
Prerequisites:
- PHP Extensions: Continues to require either the PHP GMP or BCMath extension, with GMP being preferred for optimal performance.
Full Changelog: https://github.com/futureweb/google-ip-prefix-diff-php/blob/main/CHANGELOG.md