I want to print a hex escaped sequence string from a Buffer
.
for instance:
buffer = .... // => <Buffer d3 e9 52 18 4c e7 77 f7 d7>
if I do:
console.log(buffer.toString('hex'));
I get:
d3e952184ce777f7d7
but I want this representation with the \x
representations (I get get from python and need to compare)
\xd3\xe9R\x18L\xe7w\xf7\xd7` // same as <Buffer d3 e9 52 18 4c e7 77 f7 d7>