Created
July 30, 2014 18:11
-
-
Save JosePedroDias/6022713b120ecc44551a to your computer and use it in GitHub Desktop.
print buffer as hex string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var i, w, res = []; | |
for (i = 0; i < b.length; ++i ) { | |
w = b[i]; | |
res.push( w.toString(16) ); | |
if (i % 2 !== 0) { | |
res.push(' '); | |
} | |
} | |
console.log( res.join('') ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment