≈ the.bay.news

Netip 0.4: fast IP network operations with arbitrary masks

The Rust Programming Language Forum
Netip 0.4: fast IP network operations with arbitrary masks
I maintain netip, a Rust library for fast IPv4/IPv6 network operations with arbitrary masks. For example, start with 10.*.0.*, represented by the mask 255.0.255.0, and exclude 10.0.0.0/9: use netip::Ipv4Network; let network = Ipv4Network::parse("10.0.0.0/255.0.255.0").unwrap(); let excluded = Ipv4Network::parse("10.0.0.0/9").unwrap(); for remaining in network.difference(&excluded) { println!("{remaining}"); } Output: 10.128.0.0/255.128.255.0 The result matches 10.{128..255}.0.*: the t...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.