ASCII ,UNICODE and BASE64. HOW COMPUTERS COMMUNICATE

Cibilex
3 min readApr 29, 2023

We communicate with computers using binary number system.Binary number system consists of 0 and 1.Each digit in the binary number system is called as a binary digit(bit).4-bit data type can store 16 different value ,8-bit data type can store 256 different value.We can store 256 different values on our computers with an 8-bit.8-bit is also called as byte.How does communication between computers work correctly? let’s delve deep

ASCII (American Standart Code for Information Interchange)

Each character is represented by a 7-bit data unit,, which means that the ASCII code system can represent 128 different values. These values include letters, figures, and some symbols.ASCII provides standard communication between computers. Each character is represented by a 7-bit data unit, with the eighth bit reserved for future use.In the 1980s extended ASCII is started to use.In extended ASCII each chracter is represented by a 8-bit data unit.So we can store 256 different value with extended ASCII. You can see ASCII table there.

The value “mehmet” is stored as “01001101 01100101 01101000 01101101 01100101 01110100” in the ASCII code system. Don’t forget to refer to the ASCII table and write your name in ASCII code sy.

UNICODE

As we can see, the characters in the ASCII code system are not sufficient to store all characters such as Chinese characters or symbols. With Unicode, each character has its own code point and is represented by an 8-bit, 16-bit, or 32-bit data unit,data size flexible. For example, “A” is stored as “01000001” and ☺ is stored as “00000000 01111100 00100000 00101010” in Unicode. Unicode has 1,114,112 different code points, and ASCII is a subset of Unicode. In both ASCII and Unicode, “mehmet” is stored the same way.Uncide chart is there

BASE64

Character lengths can become very long when stored in ASCII or Unicode. Using ASCII or Unicode can be costly when communicating between two computers. With the Base64 algorithm, each 6-bit data size in ASCII or Unicode is stored in a unique character that has a size of 8 bits. As a result, the data size increases by 33%. Base64 is used to ensure secure and accurate transfer of data, especially for binary data such as images, audio files, and video files. It is commonly used to transfer non-textual data between systems.Base64 chart is there

console.assert("mehmet".length==6)
console.assert(btoa("mehmet").length==8) //btoa(text) encodes text as base64iin js

Conclusion

  • Modern programming languages store the values we create as Unicode. While we think we are working on the data directly, in reality, operations are performed on the underlying Unicode values.
  • When communicating between two computers, using Base64 to transfer data ensures that the data is transmitted accurately and securely. The data is first converted from ASCII or Unicode to Base64 on the sending computer, and then converted back to ASCII or Unicode on the receiving computer. This process prevents data loss and ensures that the data is transferred accurately and securely.

--

--

Cibilex

As an inquisitive full stack developer | Vue.js master, I enjoy crafting elegant solutions to complex problems.