summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/network/long2ip.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/locutus/php/network/long2ip.js')
-rw-r--r--node_modules/locutus/php/network/long2ip.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/node_modules/locutus/php/network/long2ip.js b/node_modules/locutus/php/network/long2ip.js
new file mode 100644
index 0000000..68683a5
--- /dev/null
+++ b/node_modules/locutus/php/network/long2ip.js
@@ -0,0 +1,15 @@
+'use strict';
+
+module.exports = function long2ip(ip) {
+ // discuss at: http://locutus.io/php/long2ip/
+ // original by: Waldo Malqui Silva (http://waldo.malqui.info)
+ // example 1: long2ip( 3221234342 )
+ // returns 1: '192.0.34.166'
+
+ if (!isFinite(ip)) {
+ return false;
+ }
+
+ return [ip >>> 24, ip >>> 16 & 0xFF, ip >>> 8 & 0xFF, ip & 0xFF].join('.');
+};
+//# sourceMappingURL=long2ip.js.map \ No newline at end of file