Answers for "js ascii to binary"

1

convert text to binary javascript

function stringToBinary(str) {
    let strOut = "";
    for (var i = 0; i < str.length; i++) {
        strOut += str[i].charCodeAt(0).toString(2);
    }
    return strOut
}
Posted by: Guest on October-29-2021
1

binary to ascii javascript

const binaryAgent = str => str.replace(/\d+./g, char => String.fromCharCode(`0b${char}`));
Posted by: Guest on August-18-2020
0

how to convert string into binary in javascript

// Text to Binary
function text2Binary(string) {
    return string.split('').map(function (char) {
        return char.charCodeAt(0).toString(2);
    }).join(' ');
}
text2Binary("Hello World");
Posted by: Guest on January-08-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language