Commit generated files

This commit is contained in:
Casper Warden
2017-12-13 15:23:50 +00:00
parent d0658438b9
commit b66f85c5bb
3097 changed files with 93947 additions and 1 deletions

34
dist/classes/IPAddress.js vendored Normal file
View File

@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ipaddr = require('ipaddr.js');
class IPAddress {
constructor(buf, pos) {
this.ip = null;
this.toString = () => {
return this.ip.toString();
};
if (buf !== undefined && buf instanceof Buffer) {
if (pos !== undefined) {
const bytes = buf.slice(pos, 4);
this.ip = ipaddr.fromByteArray(bytes);
}
else {
if (ipaddr.isValid(buf)) {
this.ip = ipaddr.parse(buf);
}
}
}
}
static zero() {
return new IPAddress('0.0.0.0');
}
writeToBuffer(buf, pos) {
const bytes = this.ip.toByteArray();
buf.writeUInt8(bytes[0], pos++);
buf.writeUInt8(bytes[1], pos++);
buf.writeUInt8(bytes[2], pos++);
buf.writeUInt8(bytes[3], pos);
}
}
exports.IPAddress = IPAddress;
//# sourceMappingURL=IPAddress.js.map