Obtained from @Musa's solution above, so I canβt get a loan, but itβs clearer to write this as an answer than my lame comment on his answer.
var byteArray = new Uint8Array(hexdata.match(/.{2}/g) .map(e => parseInt(e, 16))); var blob = new Blob([byteArray], {type: "application/octet-stream"});
Maybe this is easier to understand? I personally find this more clear.
source share