ip: minor.
This commit is contained in:
parent
e38da91065
commit
34421c1653
@ -411,9 +411,8 @@ IP.toString = function toString(raw) {
|
||||
}
|
||||
|
||||
if (raw.length === 16) {
|
||||
let host = '';
|
||||
|
||||
if (IP.isMapped(raw)) {
|
||||
let host = '';
|
||||
host += raw[12];
|
||||
host += '.' + raw[13];
|
||||
host += '.' + raw[14];
|
||||
@ -422,10 +421,12 @@ IP.toString = function toString(raw) {
|
||||
}
|
||||
|
||||
if (IP.isOnion(raw)) {
|
||||
host = base32.encode(raw.slice(6));
|
||||
const host = base32.encode(raw.slice(6));
|
||||
return `${host}.onion`;
|
||||
}
|
||||
|
||||
let host = '';
|
||||
|
||||
host += raw.readUInt16BE(0, true).toString(16);
|
||||
|
||||
for (let i = 2; i < 16; i += 2) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user