UNPKG
ip-utils
Version:
latest (2.4.0)
2.4.0
2.3.0
2.2.2
2.2.1
2.1.1
2.1.0
2.0.3
2.0.2
2.0.1
2.0.0
Library of useful functions related to IP
github.com/librasean/IP-Utils
librasean/IP-Utils
ip-utils
/
lib
/
module
/
esnext
/
LastHost.js
8 lines
(7 loc)
•
264 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
import
{ fromLong }
from
'./FromLong'
;
import
{ broadcastAddress }
from
'./BroadcastAddress'
;
import
{ toLong }
from
'./ToLong'
;
export
function
lastHost
(
subnet
) {
let
broadcastLong =
broadcastAddress
(subnet);
return
fromLong
(
toLong
(broadcastLong) -
1
); }