I am using node.js.
I have this string msg_str with the following contents "0102ab00aabb00". I want to convert this string content (ASCII representing binary hex) and store it into a Buffer such that the contents of the Buffer looks like <01 02 ab 00 aa bb 00 >.
Some preliminary code I wrote which does not work as expected;
msg_str = "0102ab00aabb00";
buffer_binary = new Buffer(msg_str);
console.log(msg_str);
console.log(buffer_binary);
The console output of buffer_binary is 30 31 30 32 61 62 30 30 61 61 62 62 30 30. The correct output should be 01 02 ab 00 aa bb 00.