How to convert text to binary code in JavaScript?

后端 未结 13 1831
囚心锁ツ
囚心锁ツ 2020-11-28 05:00

Text to Binary Code

I want JavaScript to translate text in a textarea into binary code.

For example, if a user types in "TEST

13条回答
  •  无人及你
    2020-11-28 05:42

    this seems to be the simplified version

    Array.from('abc').map((each)=>each.charCodeAt(0).toString(2)).join(" ")
    

提交回复
热议问题