Long to IP address - Node.js Network

Node.js examples for Network:IP Address

Description

Long to IP address

Demo Code

function js_long2ip(ip) {
  if ( !ip )/*  ww w .ja  v  a2  s  .  c o  m*/
    return '';
  if ( angular.isString( ip ) && ip.indexOf('.') >= 0 )
    return ip;
  return [ip >>> 24, ip >>> 16 & 0xFF, ip >>> 8 & 0xFF, ip & 0xFF].join('.');
}

Related Tutorials