Blockchain tutorial 31: Base-32 encoding
ฝัง
- เผยแพร่เมื่อ 7 ก.พ. 2025
- If you like this video and want to support me, go this page for my donation crypto addresses:
/ mobilefish
This is part 32 of the Blockchain tutorial.
In this video series different topics will be explained which will help you to understand blockchain.
It is recommended to watch each video sequentially as I may refer to certain Blockchain topics explained earlier.
In this tutorial I will explain how the base-32 encoding works.
Base-32 is basically a way of encoding arbitrary binary data in ASCII text.
A base-32 encoded value only contains uppercase letters, digits and the equal sign as padding.
Such a value (excluding padding) can be included in a URL without encoding any characters.
Base-32 encoding schemes uses the 26 uppercase letters A-Z, and the digits 2-7.
This encoding scheme is defined in RFC 4648, see: tools.ietf.org...
The 0 and 1 are skipped due to their similarity with the letters O and I.
For example lets base-32 encode the word "Cat".
Cat in ASCII decimal values = [67, 97, 116]
Cat in binary format = [01000011, 01100001, 01110100]
Step 1: Convert an input byte stream into a group of 5 bytes.
If there are less than 5 bytes, at the end, pad additional empty bytes.
Group = [01000011, 01100001, 01110100, xxxxxxxx, xxxxxxxx]
Step 2. Divide this group into 8 chunks of 5 bits.
Chunks = [01000, 01101, 10000, 10111, 0100x, xxxxx, xxxxx, xxxxx]
Step 3. If a chunk has both actual bits and empty bits, replace the empty bits with 0’s.
Chunks = [01000, 01101, 10000, 10111, 01000, xxxxx, xxxxx, xxxxx]
Step 4. Convert each 5 bits chunk to its decimal value (0-31).
If a 5 bits chunk contains empty bits replace with character ‘=’.
Chunks = [8, 13, 16, 23, 8, =, =, =]
Step 5. In the base-32 symbol chart, map each decimal value to its corresponding character.
Chunks = [I, N, Q, X, I, =, =, =]
Step 6. The word “Cat” base-32 encoded is “INQXI===”
Check out all my other Blockchain tutorial videos:
• Blockchain tutorial
Subscribe to my TH-cam channel:
/ @mobilefish
The presentation used in this video tutorial can be found at:
www.mobilefish...
#mobilefish #blockchain #bitcoin #cryptocurrency #ethereum
Finished the whole course and want to thank the author!
You're welcome.
Thanks man, you just helped me with my midterm exam. You have a new subscriber and new like.
Great work please continue 🙏 may you will have some gratification from faith
Monero Devs have proposed moving from base-58 to base-32.
Could you make a video on the differences as well as any security issues that may arrive?
Thanks man that was really helpful. The actual IETF article made sound so complicated smh
Hi Professor, Please make videos on hyperleger fabric.
Great explanation. Quick question here, does it have to add zero up to 5 bytes over the original data? What if the original data is more than 5 bytes? How will base32 work?
Example: CatCat
Binary format:
[01000011, 01100001, 01110100, 01000011, 01100001, 01110100]
Group of 5 bytes:
[01000011, 01100001, 01110100, 01000011, 01100001] [01110100, xxxxxxxx, xxxxxxxx, xxxxxxxx, xxxxxxxx]
8 chunks of 5 bits:
[01000, 01101, 10000, 10111, 01000, 10000, 11011, 00001]
[01110, 100xx, xxxxx, xxxxx, xxxxx, xxxxx, xxxxx, xxxxx]
If a chunk has both actual bits and empty bits, replace the empty bits with 0’s:
[01000, 01101, 10000, 10111, 01000, 10000, 11011, 00001]
[01110, 10000, xxxxx, xxxxx, xxxxx, xxxxx, xxxxx, xxxxx]
Convert each 5 bits chunk to its decimal value (0-31).
If a 5 bits chunk contains empty bits replace with character ‘=’
[8, 13, 16, 23, 8, 16, 27, 1]
[14, 16, =, =, =, =, =, =]
In the base-32 symbol chart, map each decimal value to its corresponding character
If a 5 bits chunk contains empty bits replace with character ‘=’
[I, N, Q, X, I, Q, 3, B]
[O, Q, =, =, =, =, =, =]
CatCat in base32 is: INQXIQ3BOQ======
isn't it supposed to be INAVI===?
in converting CAT ASCII to binary you make error.
cat is 01000011 01000001 01010100
Hello friend, something to communicate with you is that I want to send you a file to see if you can remove the encryption
For legal reasons do not send me any files for me to remove the encryption. By the way removing encryption is NOT EASY and probably impossible to achieve.
Hi sir Thank you for the your best video but I have a little Dot in Step 4 . How we convert in decimal values.
Plz sir tell me
Thank you again.
We use "8" to represent eight in decimal, meanwhile we use "01000" to represent eight in binary.
We have got binary numbers in step 3; What step 4 do is turning binary numbers from step 3 into decimal number.
That's why "01000"->"8".