What is Encoding? How Does Encoding Work?
There are a lot of technologies for providing the safety of important data or transferring them. We’re going to talk about some of them. The technologies could be confused(encoding, encryption, hashing) easily with each other. We’ll take a look at encoding and explain how it actually works.
Encoding
Encoding is a data-changing process, obviously, but the most important thing is that it’s reversible. Let’s assume we have to create computer programming that holds tree types and save them to DB. But the problem could be here, the tree names could be so long thus the DB may become too bloated. The main problem is here, DB Indexing, but we just wanted to create a scenario. We’re going to talk about the actual usage of encoding later. Any way to fix the problem, we can say whenever we see the pine tree, we’re gonna say the pine tree is type 1, walnut tree could be 2, etc.
In the scenario that we are taking, we are going to convert all data according to this scheme.
We converted tree names to numbers.
After then we just need to retrieve the type list and convert it.
So whenever when we want to use the data back, we can write a function that converts numbers to tree names.
Even though we used this scenario to demonstrate how encoding works.
In real: ASCII Table
When you’re reading this article, your computer (PC or phone) tries to display the letters in order. But how your computer knows the letters? It’s time to talk about the encoding. As you know, computers know binary language only. Your computer is trying to decode those binary values to real values according to an ASCII table and display them while you’re reading these paragraphs. The ASCII(American Standard Code for Information Interchange), table is a scheme. So every letter has a unique binary value according to this scheme. For example;
a = 1100001
That’s how computers can understand letters.
If you want to one more article about how ASCII table works and how computers work, I would like to write one more article about them.
Base64
I’ll talk about this encoding standard later. But if you’ve ever been interested in data transfer, you’ve probably heard of the term. Base64 is an encoding standard with which you can transfer data.
Finally
We know how encoding works, and we know how encoding can be used in a real scenario. But Encoding is not for protecting or securing data because it is easy to reverse. Even though it can be used to make things harder. Also, encryption uses an algorithm that basically works like encoding. But encryption has its own terms, like keys. Encryption is a broad term that involves encoding.
https://en.wikipedia.org/wiki/ASCII
https://www.packetlabs.net/posts/encryption-encoding-and-hashing/#:~:text=Encoding%3A%20Reversible%20transformation%20of%20data,protect%20the%20confidentiality%20of%20data.