How to use the fromLong function from ip
Find comprehensive JavaScript ip.fromLong code examples handpicked from public code repositorys.
GitHub: markzhan/ip2
![markzhan profile picture](/markzhan.png?size=40)
22 23 24 25 26 27 28 29 30 31
break; } } if (ret) { if (id === 'long') { var ipaddr = ip.fromLong(ret[0]); console.log(ip.isPrivate(ipaddr) ? 'Private IP:' : 'IP:', ipaddr); } else if (id === 'ip') { if (ip.isPrivate(ret[0])) { console.log('Private IP:', ip.toLong(ret[0]));
+ 2 other calls in file
98 99 100 101 102 103 104 105 106 107
} get length() { return this.subnet.length; } nth(i) { return ip.fromLong(ip.toLong(this.ip) + i); } range(lower, upper) { let ips = []; for (let i = lower; i <= upper; i++) {
5730 5731 5732 5733 5734 5735 5736 5737 5738 5739
}, 'bytes' : function() { return st + ' B'; }, 'ipv4': function() { return ip.fromLong(parseInt(st)); }, 'unix_timestamp' : function() { return String(new Date(parseInt(st) * 1000)); },
GitHub: natesilva/rir-parser
105 106 107 108 109 110 111 112 113
var bordermask = ip.toLong('0.0.0.255'); var endmask = ip.toLong('255.255.255.255'); var increment = 1; while (curr < ((end & endmask) >>> 0) && ((curr & bordermask) >>> 0)) { pushTarget.push( {range: ip.fromLong(curr) + '/' + '32', kind: 'ipv4', country: country} ); curr += increment; }
+ 6 other calls in file
56 57 58 59 60 61 62 63 64
r = Ip.toLong(e.dval.start); } e.lastIp = r; O.link.close(socket, Ip.fromLong(r)); });
GitHub: lyc458216/Asch-fork
177 178 179 180 181 182 183 184 185 186 187
return cb(null, []) } Peer.prototype.remove = (pip, port, cb) => { const peers = library.config.peers.list const isFrozenList = peers.find(peer => peer.ip === ip.fromLong(pip) && peer.port === port) if (isFrozenList !== undefined) return cb && cb('Peer in white list') // FIXME return cb() }
+ 2 other calls in file
113 114 115 116 117 118 119 120 121 122
}; if (info.host === 0) { info.host = options.proxy.ipaddress; } else { info.host = ip.fromLong(info.host); } finish(null, socket, info, callback); } else {
+ 3 other calls in file
GitHub: Denisqvx/arkeros
15 16 17 18 19 20 21 22 23
field: 'ip', type: 'String', get(pixel) { if (!pixel.numIp) return ''; return nodeIp.fromLong(pixel.numIp); }, }, ],
12 13 14 15 16 17 18 19 20 21
input = input.substr(2); } const number = parseInt(input, base); output = ip.fromLong(number); } return resolve({ success: true,
31 32 33 34 35 36 37 38 39
let cnt = 0; let list = []; networks.map(async (network) => { for(let i = ip.toLong(network.firstAddress), l = ip.toLong(network.lastAddress); i < l + 1; i++){ let address = ip.fromLong(i) if (myAddress.indexOf(address) != -1) continue; cnt++;
GitHub: atefBB/browserify-app
![atefBB profile picture](/atefBB.png?size=40)
416 417 418 419 420 421 422 423 424 425
} var numberOfAddresses = Math.pow(2, 32 - maskLength); return { networkAddress: ip.fromLong(networkAddress), firstAddress: numberOfAddresses <= 2 ? ip.fromLong(networkAddress) : ip.fromLong(networkAddress + 1), lastAddress: numberOfAddresses <= 2 ?
+ 17 other calls in file
ip.address is the most popular function in ip (635 examples)