Base64 encoder decoder কী করে?
এই Base64 tool text encode ও decode করে। Encode বোতাম input text-কে TextEncoder দিয়ে UTF-8 bytes-এ বদলায়, তারপর byte string থেকে btoa চালিয়ে Base64 output তৈরি করে। Decode বোতাম input Base64 text-কে atob দিয়ে binary string বানায়, তারপর TextDecoder দিয়ে আবার readable text-এ ফেরায়। Invalid Base64 দিলে error message দেখায়। Swap বোতাম output-কে input-এ নিয়ে আসে, Clear সব খালি করে এবং Copy output clipboard-এ রাখে। বাংলা, ইংরেজি, emoji বা Unicode text encode করার জন্য UTF-8 handling গুরুত্বপূর্ণ; এই tool সেটি করে।
Base64 কীভাবে পড়বেন?
Base64 binary data-কে printable text character-এ প্রকাশ করে। Alphabet হলো A-Z, a-z, 0-9, plus এবং slash; padding হিসেবে equals sign ব্যবহার হয়। 3 byte data সাধারণত 4 Base64 character-এ যায়, তাই output input-এর তুলনায় বড় হয়। JSON payload, API token display, email attachment, data URL, config value বা ছোট binary snippet text-only channel-এ পাঠাতে Base64 দেখা যায়। কিন্তু Base64 data compress করে না এবং গোপনও করে না; যে কেউ decode করতে পারে।
Encode ও decode ব্যবহার
Encode করার সময় input যেমন আছে, space, line break ও Unicode character সহ সব byte representation-এ যায়। Decode করার সময় input trim করা হয়, তারপর Base64 হিসেবে পড়া হয়। Swap workflow encode-decode round trip পরীক্ষা করতে সুবিধা দেয়: text encode করুন, swap করুন, decode করুন, মূল text ফিরে আসে কিনা দেখুন। Copy বোতাম শুধু output কপি করে, তাই input ভুল হলে output-ও ভুল থাকবে। Long Base64 string line wrap সহ paste করলে কিছু ক্ষেত্রে whitespace সমস্যা হতে পারে; প্রয়োজনে পরিষ্কার string ব্যবহার করুন।
সতর্কতা
Base64 encryption নয়, hashing নয়, authentication নয়। Password, private key, personal token বা sensitive document Base64 করলে সেটি শুধু অন্য format-এ লেখা হয়; নিরাপদ হয় না। URL-এ ব্যবহার করতে হলে standard Base64-এর plus, slash ও equals character সমস্যা করতে পারে; URL-safe Base64 আলাদা convention ব্যবহার করে, যা এই tool আলাদা করে প্রয়োগ করে না। Very large file encode করার জন্য এই textarea tool উপযুক্ত নয়, কারণ browser memory ও clipboard সীমা আছে। API debugging, text payload পরীক্ষা, Unicode encoding বোঝা বা ছোট config value transform করার জন্য এটি ব্যবহার করুন। Production system-এ binary-to-text conversion, compression, encryption ও signing আলাদা ধাপ হিসেবে ভাবা উচিত।
Base64 output কখনো line break ছাড়া এক লম্বা string হয়, আবার কিছু system প্রতি 76 character-এ wrap করে। কোন format গ্রহণযোগ্য তা receiving system-এর নিয়মে নির্ভর করে। Data URL বানালে MIME type, comma separator এবং encoded payload আলাদা অংশ। JSON field-এ Base64 বসালে quote escaping ঠিক আছে কিনা দেখুন। Decode result unreadable হলে input হয়তো binary data, compressed data বা wrong character encoding বহন করছে।
মন্তব্য