I\'m writing an app in node.js, and see that I can do things like this:
var buf = new Buffer(\"Hello World!\") console.log(buf.toString(\"hex\")) console.log
As is always the way, I spent a while Googling but found nothing until after I posted the question:
http://www.w3resource.com/node.js/nodejs-buffer.php has the answer. You can use the following types in .toString() on a buffer:
.toString()
ascii
utf8
utf16le
ucs2
base64
binary
hex