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
function hex(buffer) { | |
var hexCodes = [] | |
var view = new DataView(buffer) | |
for (var i = 0; i < view.byteLength; i += 4) { | |
var value = view.getUint32(i).toString(16) | |
var padding = '00000000' | |
var code = (padding + value).slice(-padding.length) | |
hexCodes.push(code) | |
} | |
return hexCodes.join('') |