function matchCIDR(first, second, partSize, cidrBits) {
        if (first.length !== second.length) {
            throw new Error("ipaddr: cannot match CIDR for objects with different lengths");
        }

        let part = 0;
        let shift;

        while (cidrBits > 0) {
            shift = partSize - cidrBits;
            if (shift < 0) {
                shift = 0;
            }

            if (first[part] >> shift !== second[part] >> shift) {
                return false;
            }

            cidrBits -= partSize;
            part += 1;
        }

        return true;
    }
// A generic CIDR (Classless Inter-Domain Routing) RFC1518 range matcher.
A generic CIDR (Classless Inter-Domain Routing) RFC1518 range matcher.
A generic CIDR ( Classless Inter - Domain Routing ) RFC1518 range matcher .
function matchCIDR(first, second, partSize, cidrBits) {
        if (first.length !== second.length) {
            throw new Error("ipaddr: cannot match CIDR for objects with different lengths");
        }
        let part = 0;
        let shift;
        while (cidrBits > 0) {
            shift = partSize - cidrBits;
            if (shift < 0) {
                shift = 0;
            }
            if (first[part] >> shift !== second[part] >> shift) {
                return false;
            }
            cidrBits -= partSize;
            part += 1;
        }
        return true;
    }
function matchCIDR ( first , second , partSize , cidrBits ) { if ( first . length !== second . length ) { throw new Error ( "ipaddr: cannot match CIDR for objects with different lengths" ) ; } let part = 0 ; let shift ; while ( cidrBits > 0 ) { shift = partSize - cidrBits ; if ( shift < 0 ) { shift = 0 ; } if ( first [ part ] >> shift !== second [ part ] >> shift ) { return false ; } cidrBits -= partSize ; part += 1 ; } return true ; }
A generic CIDR (Classless Inter-Domain Routing) RFC1518 range matcher.
A generic CIDR ( Classless Inter - Domain Routing ) RFC1518 range matcher .