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/

HK boy viết 17:37 ngày 01/10/2018

Ở đây có nói:

en.wikipedia.org

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 ...

The “=” symbol is also used as a special suffix code.

Huynh Tan Thanh viết 17:45 ngày 01/10/2018

Em cảm ơn…

Bài liên quan
0