2進製到ASCII字符串在線轉換工具



關於2進製到ASCII字符串在線轉換工具:

這個在線2進製到ASCII字符串轉換工具可幫助您將一個2進制數組轉換為ASCII字符串.

支持的2進制數組分割符號包括 ("", " ", "\n", "\t").

二進制(Binary):

二進制只有2種字符(0, 1) . 4位二進製字符可以表示1位十六進制數字, 3位二進製字符可以表示1位八進制數字.二進制是最接近彙編語言的數字系統.

ASCII編碼標準:

ASCII (American Standard Code for Information Interchange)是最廣泛使用的字符編碼標準.標準ASCII有7 bits長度,共128個不同的字符.擴展ASCII有8 bits長度, 256個不同的字符.版權符號©就定義在擴展ASCII表之中.

comic hex to ascii

鏈接:

維基百科(二進制): https://en.wikipedia.org/wiki/Binary_number

維基百科 (ASCII): https://en.wikipedia.org/wiki/ASCII

用Python進行2進製到ASCII字符串轉換:

def binary_to_text(binary_str):
    binary_str = binary_str.replace(' ', '').replace('0x', '').replace('\t', '').replace('\n', '')
    return ''.join(chr(int(binary_str[i * 8:i * 8 + 8], 2)) for i in range(len(binary_str) // 8))


binary_input = '01100101 01111000 01100001 01101101 01110000 01101100 01100101'
text_output = binary_to_text(binary_input)
print('Text result is:{0}'.format(text_output))

-------------------
Text result is:example