going to start messing with dnspacket.js, so I wanted to commit
This commit is contained in:
parent
7a2fc325ed
commit
28cfda23a6
|
@ -18,6 +18,8 @@ var SECTION_NAMES = [
|
||||||
];
|
];
|
||||||
var ALL_SECTION_NAMES = ['question'].concat(SECTION_NAMES);
|
var ALL_SECTION_NAMES = ['question'].concat(SECTION_NAMES);
|
||||||
|
|
||||||
|
// parses through the flags
|
||||||
|
|
||||||
function parseFlags(val, packet) {
|
function parseFlags(val, packet) {
|
||||||
packet.header.qr = (val & 0x8000) >> 15;
|
packet.header.qr = (val & 0x8000) >> 15;
|
||||||
packet.header.opcode = (val & 0x7800) >> 11;
|
packet.header.opcode = (val & 0x7800) >> 11;
|
||||||
|
|
|
@ -53,6 +53,8 @@ return binString;
|
||||||
var str = binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100');
|
var str = binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100');
|
||||||
|
|
||||||
console.log(str);
|
console.log(str);
|
||||||
|
|
||||||
|
parse
|
||||||
//translates to "Aren't"
|
//translates to "Aren't"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue