source/lib/VBListPanel.js
// Convert an IP address from a dotted decimal string to a 32-bit integer

Convert an IP address from a dotted decimal string to a 32-bit integer
Convert an IP address from a dotted decimal string to a 32 - bit integer
function ipAddrTo32 (ipAddr) {
  let ip32 = 0
  const ma = ipAddr.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/)
  if (Array.isArray(ma) && ma.length === 5) {
    const d0 = parseInt(ma[1], 10)
    const d1 = parseInt(ma[2], 10)
    const d2 = parseInt(ma[3], 10)
    const d3 = parseInt(ma[4], 10)
    ip32 = ((d0 * 256 + d1) * 256 + d2) * 256 + d3
  }
  return ip32
}
function ipAddrTo32 ( ipAddr ) { let ip32 = 0 const ma = ipAddr . match ( / ^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$ / ) if ( Array . isArray ( ma ) && ma . length === 5 ) { const d0 = parseInt ( ma [ 1 ] , 10 ) const d1 = parseInt ( ma [ 2 ] , 10 ) const d2 = parseInt ( ma [ 3 ] , 10 ) const d3 = parseInt ( ma [ 4 ] , 10 ) ip32 = ( ( d0 * 256 + d1 ) * 256 + d2 ) * 256 + d3 } return ip32 }
Convert an IP address from a dotted decimal string to a 32-bit integer
Convert an IP address from a dotted decimal string to a 32 - bit integer