Needing to convert a Base64 string to Hexadecimal with javascript.
Example:
var base64Value = \"oAAABTUAAg==\"
Need conversion m
atob() then charCodeAt() will give you binary & toString(16) will give you hex.
function base64ToHex(str) {
const raw = atob(str);
let result = '';
for (let i = 0; i < raw.length; i++) {
const hex = raw.charCodeAt(i).toString(16);
result += (hex.length === 2 ? hex : '0' + hex);
}
return result.toUpperCase();
}
console.log(base64ToHex("oAAABTUAAg=="));