summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/network/long2ip.js
diff options
context:
space:
mode:
authorMarvin Borner2018-11-07 18:02:36 +0100
committerMarvin Borner2018-11-07 18:02:36 +0100
commit824a2d9f587ca017fc71b84d835e72f54f9c87c4 (patch)
tree765267ea4686f752aad1f69930cfee5680cc494a /node_modules/locutus/php/network/long2ip.js
parentfe75612e86b493a4e66c4e104e22658679cc014f (diff)
Began rewrite
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