I need to write a code on js that would take hex numbers from cells, then translate them into a binary and write it to a file in ASCII.
function download() { var str=""; var str1="";// var arr = [];// var vrows = document.getElementsByName("data");//ΠΏΠΎΠ»ΡΡΠ°Π΅ΠΌ ΠΌΠ°ΡΡΠΈΠ² ΡΡΠ΅Π΅ΠΊ for(var c=0;c<vrows.length;c++)//ΠΈΠ΄Π΅ΠΌ Π² ΡΠΈΠΊΠ»Π΅ { str1="0x"+vrows[c].innerHTML;//Π·Π°Π½ΠΎΡΠΈΠΌ Π² ΠΌΠ°ΡΡΠΈΠ² Π·Π½Π°ΡΠ΅Π½ΠΈΡ ΡΡΠ΅Π΅ΠΊ ΠΈ Π΄ΠΎΠ±Π°Π²Π»ΡΠ΅ΠΌ 0x arr.push(parseInt(str1,16));//ΠΏΠ°ΡΡΠΈΠΌ Π² ΠΈΠ½Ρ str+=String.fromCharCode(parseInt(str1,16));//ΡΠΎΠΈΠ±ΡΠ°Π΅ΠΌ ΡΡΡΠΎΠΊΡ ΠΈΠ· ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ² } alert (str);//Π²ΡΠ²ΠΎΠ΄ΠΈΠΌ (Π΄Π»Ρ ΡΠ΅Π±Ρ) var blob = new Blob([str], {//ΡΠΎΠ·Π΄Π°Π΅ΠΌ ΡΠ°ΠΉΠ» ΠΈ ΡΠΎΡ
ΡΠ°Π½ΡΠ΅ΠΌ type: "application/octet-stream"});// saveAs(blob, "core.bin");// } I have already tried to translate into a binary of 16 and save, and that just did not try. Does not exceed. Saves to UTF8 and distorts text ...