UNPKG
phpjs
Version:
latest (1.3.2)
1.3.2
1.2.2
1.1.2
1.0.2
1.0.1
1.0.0
0.0.1
php.js offers community built php functions in javascript
phpjs.org
kvz/phpjs
phpjs
/
functions
/
network
/
long2ip.js
11 lines
(9 loc)
•
304 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
function
long2ip
(
ip
) {
// From: http://phpjs.org/functions
// + original by: Waldo Malqui Silva
// * 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
(
'.'
); }