A utility class to determine if a Multiaddr contains another multiaddr.
This can be used with ipcidr ranges to determine if a given multiaddr is in a ipcidr range.
import { multiaddr, MultiaddrFilter } from '@multiformats/multiaddr'const range = multiaddr('/ip4/192.168.10.10/ipcidr/24')const filter = new MultiaddrFilter(range)const input = multiaddr('/ip4/192.168.10.2/udp/60')console.info(filter.contains(input)) // true Copy
import { multiaddr, MultiaddrFilter } from '@multiformats/multiaddr'const range = multiaddr('/ip4/192.168.10.10/ipcidr/24')const filter = new MultiaddrFilter(range)const input = multiaddr('/ip4/192.168.10.2/udp/60')console.info(filter.contains(input)) // true
Private
Readonly
A utility class to determine if a Multiaddr contains another multiaddr.
This can be used with ipcidr ranges to determine if a given multiaddr is in a ipcidr range.
Example