01/10/2018, 15:34
Tại sao khi mã hóa theo chuẩn base64 thường có dấu '=' trong đoạn mã
Theo như em tìm hiểu trên mạng thì:
“Chuẩn Base64 là một tập hợp gồm các ký tự (theo đúng thứ tự) : từ A đến Z, từ a đến z, từ 0 đến 9, dấu +, dấu /”
Vậy tại sao em mã hóa chuỗi “abcd” lại ra kết quả “YWJjZA==”
Sao lại có dấu ‘=’ vậy ạ, theo qui ước trên thì chỉ có các kí tự đã đề cập thôi chứ nhỉ @@
Em mã hóa trên trang https://www.base64encode.org/
Bài liên quan
Ở đây có nói:
Base64
Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding. Each base64 digit represents exactly 6 bits of data. Three 8-bit bytes (i.e., a total of 24 bits) can therefore be represented by four 6-bit base64 digits. The particular set of 64 characters chosen to represent the 64 place-values for the base varies between ...
Em cảm ơn…