Forum Discussion
Mosh
7 years agoProfessor
For info, HMAC byte array conversion to hex string.
var HexUtils =
{
convertByteArrayToHex : function(byteArray)
{
var hex = "";
byteArray.forEach(function(byteValue) { hex += HexUtils.convertByteToHex(byteValue) });
return hex;
},
convertByteToHex : function(b)
{
var hexChar = ["0", "1", "2", "3", "4", "5", "6", "7","8", "9", "a", "b", "c", "d", "e", "f"];
return hexChar[(b >> 4) & 0x0f] + hexChar[b & 0x0f];
}
};
Related Content
- 2 years ago
- 10 months ago
- 7 months ago
- 2 months ago