What is base64 encoding used for?

后端 未结 18 917
滥情空心
滥情空心 2020-11-22 09:45

I\'ve heard people talking about \"base 64 encoding\" here and there. What is it used for?

18条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-22 09:56

    In the early days of computers, when telephone line inter-system communication was not particularly reliable, a quick & dirty method of verifying data integrity was used: "bit parity". In this method, every byte transmitted would have 7-bits of data, and the 8th would be 1 or 0, to force the total number of 1 bits in the byte to be even.

    Hence 0x01 would be transmited as 0x81; 0x02 would be 0x82; 0x03 would remain 0x03 etc.

    To further this system, when the ASCII character set was defined, only 00-7F were assigned characters. (Still today, all characters set in the range 80-FF are non-standard)

    Many routers of the day put the parity check and byte translation into hardware, forcing the computers attached to them to deal strictly with 7-bit data. This force email attachments (and all other data, which is why HTTP & SMTP protocols are text-based), to be convert into a text-only format.

    Few of the routers survived into the 90s. I severely doubt any of them are in use today.

提交回复
热议问题