Get Binary to Text working
brahmnw opened this issue · 9 comments
brahmnw commented
It's pretty annoying when someone tries to do that and goes; "AAAAAAAAAAAAAAAAA LAMEEEEEEEEEEE"
SpectrixDev commented
AAAAAAAAAAAAAAAAAAAAAAAAAAA
Firstly: It's not even in this version, and I'm pretty sure it's never been on this repo
Secondly: I'm going to be adding all of that now, loads of text converter things
this isn't even a bug it's just never been a thing, nor is it an issue ;-;
samhza commented
const textToBin = str => str.split('').map(c=>c.charCodeAt(0).toString(2)).join(" ")
console.log(textToBin("lame"))
// "1101100 1100001 1101101 1100101"There we go. Ohhh, oops, my bad, you guys meant binary to text. I definitely misread that.
const binToText = str => str.split(/[\s,]+/g).map(b=>String.fromCharCode(parseInt(b, 2))).join("")
console.log(binToText("1101100 1100001 1101101 1100101"))
// "lame"SpectrixDev commented
as you can see from above, python is much easier than js.
:)
brahmnw commented
^
samhza commented
One lang can't be objectively easier than another.
brahmnw commented
One lang can't be objectively better than another
samhza commented
Ok
SpectrixDev commented
I'm closing this because it's not even an issue
SpectrixDev commented
I added it here. If there's any actual problems, open up another issue