fixed lint
This commit is contained in:
parent
1a18ae9dbc
commit
5320844a7a
|
@ -2,32 +2,32 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function int2ip(ipInt: number) {
|
export function int2ip(ipInt: number): string {
|
||||||
return ((ipInt >>> 24) + '.' + (ipInt >> 16 & 255) + '.' + (ipInt >> 8 & 255) + '.' + (ipInt & 255));
|
return ((ipInt >>> 24) + '.' + (ipInt >> 16 & 255) + '.' + (ipInt >> 8 & 255) + '.' + (ipInt & 255));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ip2int(ip: string) {
|
export function ip2int(ip: string): number {
|
||||||
return ip.split('.').reduce(function (ipInt, octet) { return (ipInt << 8) + parseInt(octet, 10); }, 0) >>> 0;
|
return ip.split('.').reduce(function (ipInt, octet) { return (ipInt << 8) + parseInt(octet, 10); }, 0) >>> 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function sec2date(ms: number) {
|
export function sec2date(ms: number): string {
|
||||||
var dateTime = new Date(ms);
|
let dateTime = new Date(ms);
|
||||||
return dateTime.toLocaleString();
|
return dateTime.toLocaleString();
|
||||||
}
|
}
|
||||||
|
|
||||||
function numHex(s: number) {
|
function numHex(s: number): string {
|
||||||
var a = s.toString(16);
|
let a = s.toString(16);
|
||||||
if ((a.length % 2) > 0) { a = "0" + a; }
|
if ((a.length % 2) > 0) { a = '0' + a; }
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function intToMac(macInt: number): string {
|
export function intToMac(macInt: number): string {
|
||||||
|
|
||||||
var hexValue = numHex(macInt);
|
let hexValue = numHex(macInt);
|
||||||
|
|
||||||
var macaddress = [];
|
let macaddress = [];
|
||||||
|
|
||||||
for (var i = 0; i < hexValue.length; i = i + 2) {
|
for (let i = 0; i < hexValue.length; i = i + 2) {
|
||||||
macaddress.push(hexValue.substr(i, 2));
|
macaddress.push(hexValue.substr(i, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user