First, Base64 code
In the project is commonly used to Base64 encoding, some are passed to the backend, some are docking API requirements, has always thought that Base64 is like MD5 encryption method (because the code after the same as garbled) ...
Originally, Base64 is to put 0~63 with a~z,a~z,0~9 and +,/a total of 64 characters to express
Divide the character length by 3, less than 0, note that the "0" here is not the Base64 corresponding to "A", but "=", so often we see ED2K and the like behind there are one or two =
Required to be encoded characters are 8bit, so must be within the ASCII encoding range, \U0000-\U00FF, Chinese will not
But a variety of languages can be used to first put the Chinese code Base64, below this is the C # version of
// Coding string SSD = convert.tobase64string (System.Text.Encoding.GetEncoding ("gb2312" ). GetBytes (" China ")); // decoding string ss = System.Text.Encoding.GetEncoding ("gb2312"). GetString (convert.frombase64string (SSD));
JS also has the corresponding BASE64 plug-ins, to search a lot. Direct reference can be Base64 to encode and decode, also support Chinese
. NET theory knowledge written preparation Day3