node_js_ipqs_db_reader
Version:
A Node JS implementation of the IPQualityScore flat file IP reputation database reader.
19 lines (18 loc) • 434 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class Utility {
static uVarInt(bytes) {
let x = 0;
let s = 0;
for (let i = 0; i < bytes.length; i++) {
let b = bytes[i];
if (b < 0x80) {
return x | (b << s);
}
x |= b & (0x7f << s);
s += 7;
}
return 0;
}
}
exports.default = Utility;