Skip to content

Add bit-wise operators for IP-addresses#31

Open
mpolk wants to merge 1 commit into
duckdb:mainfrom
mpolk:bit-ops
Open

Add bit-wise operators for IP-addresses#31
mpolk wants to merge 1 commit into
duckdb:mainfrom
mpolk:bit-ops

Conversation

@mpolk

@mpolk mpolk commented May 1, 2026

Copy link
Copy Markdown

Add bit-wise operators ("&", "|" and "~") for the IP-addresses.

The ability to perform bit-wise operations on IP addresses and masks seems highly desirable for manipulating network traffic data during investigations of various network incidents. The lack of bit-wise operations and the resulting need for external scripts creates significant inconvenience, so the proposed addition seems quite useful.

The only drawback of the proposed solution appears to be the inability to meaningfully interpret binary bit-wise operations on the network mask. In this implementation, the mask of the first operand is arbitrarily copied into the result. This violates the commutativity of operations, but this sacrifice of purity for ease of manipulation does not seem particularly significant.

Add bitwise operators ("&", "|" and "~") for the IP-addresses
@mpolk mpolk changed the title Add bit-wise operators for the IP-addresses Add bit-wise operators for IP-addresses May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant