Talking about encoding Base64, Hex, UTF-8, enCodeURI, etc.

  Most of the wonderful answers on the Internet, this essay is only for your own use;

  First of all, the computer only recognizes binary, 0 and 1, so the words we see now are encoded by binary data; the computer can do many things for the combination of 0 and 1, and these rules are defined by humans;

  When people define the data structure of 0 and 1 of the computer to do things, if everyone uses different data structures and definitions, it will make the things that the computer do between people and people cannot be unified, and it will also lead to inability to communicate. Therefore, it is necessary to jointly define a set of rules that everyone agrees with. The ASCii code is the initial exchange code, which is used to record information and exchange information;

  Different encodings of the same byte string will have different displays. Only the correct encoding can express the information to be recorded in the string itself, and the information is for people. understand;

  Hex coding is coded with 4 bits as a unit, 4 is used because the computer carry is a multiple of 2, and in order to divide the bit string, the most appropriate is to take hexadecimal; so Hex coding is hexadecimal coding; use For humans to view bit strings in a more intuitive and brief way than using bits, of course, taking more bits is not suitable for population calculation;

  

  to be continued

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325891466&siteId=291194637