{"id":334,"date":"2017-02-03T23:51:57","date_gmt":"2017-02-03T15:51:57","guid":{"rendered":"http:\/\/www.rainweb.site\/?p=334"},"modified":"2017-02-03T23:51:57","modified_gmt":"2017-02-03T15:51:57","slug":"base-article15","status":"publish","type":"post","link":"http:\/\/rain1024.com\/index.php\/2017\/02\/03\/base-article15\/","title":{"rendered":"Base64\u4e13\u9898&#8212;Base64\u7f16\u7801\u7684\u539f\u7406"},"content":{"rendered":"<h4>\u5e73\u65f6\u7ecf\u5e38\u4f1a\u7528\u5230base64\u7f16\u7801\u6765\u52a0\u5bc6\u6216\u8005\u89e3\u5bc6\u6570\u636e\uff0c\u5728java\uff0cphp\uff0cpython\u4e2d\u90fd\u5199\u8fc7\u5173\u4e8e\u600e\u6837\u4f7f\u7528\u7684base64\u7684\u4ee3\u7801\uff0c\u60f3\u7740\u53d1\u5230\u535a\u5ba2\u91cc\uff0c\u4f46\u53d1\u73b0\u6211\u81ea\u5df1\u53ea\u662f\u4f1a\u7528\uff0c\u5e76\u4e0d\u6e05\u695abase64\u7684\u539f\u7406\uff0c\u6240\u4ee5\u5728\u53d1\u6e90\u7801\u4e4b\u524d\u5148\u8865\u5145\u4e00\u7bc7\u5173\u4e8ebase64\u539f\u7406\u7684\u4ecb\u7ecd\uff0c\u81ea\u5df1\u5b66\u4f1a\u4e86\u624d\u597d\u7ed9\u522b\u4eba\u8bf4\u3002\u4e0b\u9762\u662f\u7ef4\u57fa\u7684\u7b54\u6848\uff0c\u611f\u89c9\u660e\u767d\u4e86\u4e9b\u3002\u6709\u5174\u8da3\u7684\u53ef\u4ee5\u53bb\u6df1\u5165\u7814\u7a76\u4e00\u4e0b\uff0c\u6e90\u4ee3\u7801\u6211\u4f1a\u8d34\u5230\u6587\u7ae0\u7684\u6700\u540e\u3002<\/h4>\n<ul>\n<li>Base64**\u662f\u4e00\u79cd\u57fa\u4e8e64\u4e2a\u53ef\u6253\u5370\u5b57\u7b26\u6765\u8868\u793a\u4e8c\u8fdb\u5236\u6570\u636e\u7684\u8868\u793a\u65b9\u6cd5\u3002\u7531\u4e8e2\u76846\u6b21\u65b9\u7b49\u4e8e64\uff0c\u6240\u4ee5\u6bcf6\u4e2a\u6bd4\u7279\u4e3a\u4e00\u4e2a\u5355\u5143\uff0c\u5bf9\u5e94\u67d0\u4e2a\u53ef\u6253\u5370\u5b57\u7b26\u3002\u4e09\u4e2a\u5b57\u8282\u670924\u4e2a\u6bd4\u7279\uff0c\u5bf9\u5e94\u4e8e4\u4e2aBase64\u5355\u5143\uff0c\u53733\u4e2a\u5b57\u8282\u53ef\u8868\u793a4\u4e2a\u53ef\u6253\u5370\u5b57\u7b26\u3002\u5b83\u53ef\u7528\u6765\u4f5c\u4e3a\u7535\u5b50\u90ae\u4ef6\u7684\u4f20\u8f93\u7f16\u7801\u3002\u5728Base64\u4e2d\u7684\u53ef\u6253\u5370\u5b57\u7b26\u5305\u62ec\u5b57\u6bcdA-Z\u3001a-z\u3001\u6570\u5b570-9\uff0c\u8fd9\u6837\u5171\u670962\u4e2a\u5b57\u7b26\uff0c\u6b64\u5916\u4e24\u4e2a\u53ef\u6253\u5370\u7b26\u53f7\u5728\u4e0d\u540c\u7684\u7cfb\u7edf\u4e2d\u800c\u4e0d\u540c\u3002<\/li>\n<li>Base64\u5e38\u7528\u4e8e\u5728\u901a\u5e38\u5904\u7406\u6587\u672c\u6570\u636e\u7684\u573a\u5408\uff0c\u8868\u793a\u3001\u4f20\u8f93\u3001\u5b58\u50a8\u4e00\u4e9b\u4e8c\u8fdb\u5236\u6570\u636e\u3002\u5305\u62ecMIME\u7684email\u3001\u5728XML\u4e2d\u5b58\u50a8\u590d\u6742\u6570\u636e\u3002<\/li>\n<\/ul>\n<h5>\u7f16\u7801\u201cMan\u201d<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-335\" src=\"http:\/\/47.93.162.35\/wp-content\/uploads\/2017\/02\/3.png\" alt=\"\" width=\"410\" height=\"123\" srcset=\"http:\/\/rain1024.com\/wp-content\/uploads\/2017\/02\/3.png 410w, http:\/\/rain1024.com\/wp-content\/uploads\/2017\/02\/3-300x90.png 300w\" sizes=\"auto, (max-width: 410px) 100vw, 410px\" \/><br \/>\n\u5728\u6b64\u4f8b\u4e2d\uff0cBase64\u7b97\u6cd5\u5c06\u4e09\u4e2a\u5b57\u7b26\u7f16\u7801\u4e3a4\u4e2a\u5b57\u7b26<br \/>\nBase64\u7d22\u5f15\u8868\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-336\" src=\"http:\/\/47.93.162.35\/wp-content\/uploads\/2017\/02\/cd2336079240319151.png\" alt=\"\" width=\"595\" height=\"633\" srcset=\"http:\/\/rain1024.com\/wp-content\/uploads\/2017\/02\/cd2336079240319151.png 595w, http:\/\/rain1024.com\/wp-content\/uploads\/2017\/02\/cd2336079240319151-282x300.png 282w\" sizes=\"auto, (max-width: 595px) 100vw, 595px\" \/><br \/>\n\u5982\u679c\u8981\u7f16\u7801\u7684\u5b57\u8282\u6570\u4e0d\u80fd\u88ab3\u6574\u9664\uff0c\u6700\u540e\u4f1a\u591a\u51fa1\u4e2a\u62162\u4e2a\u5b57\u8282\uff0c\u90a3\u4e48\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u65b9\u6cd5\u8fdb\u884c\u5904\u7406\uff1a\u5148\u4f7f\u75280\u5b57\u8282\u503c\u5728\u672b\u5c3e\u8865\u8db3\uff0c\u4f7f\u5176\u80fd\u591f\u88ab3\u6574\u9664\uff0c\u7136\u540e\u518d\u8fdb\u884cbase64\u7684\u7f16\u7801\u3002\u5728\u7f16\u7801\u540e\u7684base64\u6587\u672c\u540e\u52a0\u4e0a\u4e00\u4e2a\u6216\u4e24\u4e2a'='\u53f7\uff0c\u4ee3\u8868\u8865\u8db3\u7684\u5b57\u8282\u6570\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5f53\u6700\u540e\u5269\u4f59\u4e00\u4e2a\u516b\u4f4d\u5b57\u8282\uff08\u4e00\u4e2abyte\uff09\u65f6\uff0c\u6700\u540e\u4e00\u4e2a6\u4f4d\u7684base64\u5b57\u8282\u5757\u6709\u56db\u4f4d\u662f0\u503c\uff0c\u6700\u540e\u9644\u52a0\u4e0a\u4e24\u4e2a\u7b49\u53f7\uff1b\u5982\u679c\u6700\u540e\u5269\u4f59\u4e24\u4e2a\u516b\u4f4d\u5b57\u8282\uff082\u4e2abyte\uff09\u65f6\uff0c\u6700\u540e\u4e00\u4e2a6\u4f4d\u7684base\u5b57\u8282\u5757\u6709\u4e24\u4f4d\u662f0\u503c\uff0c\u6700\u540e\u9644\u52a0\u4e00\u4e2a\u7b49\u53f7\u3002 \u53c2\u8003\u4e0b\u8868\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-337\" src=\"http:\/\/www.rain1024.com\/wp-content\/uploads\/2017\/02\/Base64-A\u4ee5\u53caBC\u7684Base64\u7f16\u7801.png\" alt=\"\" width=\"654\" height=\"250\" \/><\/p>\n<h5>\u5728URL\u4e2d\u7684\u5e94\u7528<\/h5>\n<ul>\n<li>Base64\u7f16\u7801\u53ef\u7528\u4e8e\u5728HTTP\u73af\u5883\u4e0b\u4f20\u9012\u8f83\u957f\u7684\u6807\u8bc6\u4fe1\u606f\u3002\u4f8b\u5982\uff0c\u5728Java\u6301\u4e45\u5316\u7cfb\u7edfHibernate\u4e2d\uff0c\u5c31\u91c7\u7528\u4e86Base64\u6765\u5c06\u4e00\u4e2a\u8f83\u957f\u7684\u552f\u4e00\u6807\u8bc6\u7b26\uff08\u4e00\u822c\u4e3a128-bit\u7684UUID\uff09\u7f16\u7801\u4e3a\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u7528\u4f5cHTTP\u8868\u5355\u548cHTTP GET URL\u4e2d\u7684\u53c2\u6570\u3002\u5728\u5176\u4ed6\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u4e5f\u5e38\u5e38\u9700\u8981\u628a\u4e8c\u8fdb\u5236\u6570\u636e\u7f16\u7801\u4e3a\u9002\u5408\u653e\u5728URL\uff08\u5305\u62ec\u9690\u85cf\u8868\u5355\u57df\uff09\u4e2d\u7684\u5f62\u5f0f\u3002\u6b64\u65f6\uff0c\u91c7\u7528Base64\u7f16\u7801\u4e0d\u4ec5\u6bd4\u8f83\u7b80\u77ed\uff0c\u540c\u65f6\u4e5f\u5177\u6709\u4e0d\u53ef\u8bfb\u6027\uff0c\u5373\u6240\u7f16\u7801\u7684\u6570\u636e\u4e0d\u4f1a\u88ab\u4eba\u7528\u8089\u773c\u6240\u76f4\u63a5\u770b\u5230\u3002<br \/>\n\u7136\u800c\uff0c\u6807\u51c6\u7684Base64\u5e76\u4e0d\u9002\u5408\u76f4\u63a5\u653e\u5728URL\u91cc\u4f20\u8f93\uff0c\u56e0\u4e3aURL\u7f16\u7801\u5668\u4f1a\u628a\u6807\u51c6Base64\u4e2d\u7684\u201c\/\u201d\u548c\u201c+\u201d\u5b57\u7b26\u53d8\u4e3a\u5f62\u5982\u201c%XX\u201d\u7684\u5f62\u5f0f\uff0c\u800c\u8fd9\u4e9b\u201c%\u201d\u53f7\u5728\u5b58\u5165\u6570\u636e\u5e93\u65f6\u8fd8\u9700\u8981\u518d\u8fdb\u884c\u8f6c\u6362\uff0c\u56e0\u4e3aANSI SQL\u4e2d\u5df2\u5c06\u201c%\u201d\u53f7\u7528\u4f5c\u901a\u914d\u7b26\u3002<br \/>\n\u4e3a\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u53ef\u91c7\u7528\u4e00\u79cd\u7528\u4e8eURL\u7684\u6539\u8fdbBase64\u7f16\u7801\uff0c\u5b83\u4e0d\u5728\u672b\u5c3e\u586b\u5145'='\u53f7\uff0c\u5e76\u5c06\u6807\u51c6Base64\u4e2d\u7684\u201c+\u201d\u548c\u201c\/\u201d\u5206\u522b\u6539\u6210\u4e86\u201c-\u201d\u548c\u201c<em>\u201d\uff0c\u8fd9\u6837\u5c31\u514d\u53bb\u4e86\u5728URL\u7f16\u89e3\u7801\u548c\u6570\u636e\u5e93\u5b58\u50a8\u65f6\u6240\u8981\u4f5c\u7684\u8f6c\u6362\uff0c\u907f\u514d\u4e86\u7f16\u7801\u4fe1\u606f\u957f\u5ea6\u5728\u6b64\u8fc7\u7a0b\u4e2d\u7684\u589e\u52a0\uff0c\u5e76\u7edf\u4e00\u4e86\u6570\u636e\u5e93\u3001\u8868\u5355\u7b49\u5904\u5bf9\u8c61\u6807\u8bc6\u7b26\u7684\u683c\u5f0f\u3002<br \/>\n\u53e6\u6709\u4e00\u79cd\u7528\u4e8e\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u6539\u8fdbBase64\u53d8\u79cd\uff0c\u5b83\u5c06\u201c+\u201d\u548c\u201c\/\u201d\u6539\u6210\u4e86\u201c!\u201d\u548c\u201c-\u201d\uff0c\u56e0\u4e3a\u201c+\u201d\uff0c\u201c*\u201d\u4ee5\u53ca\u524d\u9762\u5728IRCu\u4e2d\u7528\u5230\u7684\u201c[\u201d\u548c\u201c]\u201d\u5728\u6b63\u5219\u8868\u8fbe\u5f0f\u4e2d\u90fd\u53ef\u80fd\u5177\u6709\u7279\u6b8a\u542b\u4e49\u3002<br \/>\n\u6b64\u5916\u8fd8\u6709\u4e00\u4e9b\u53d8\u79cd\uff0c\u5b83\u4eec\u5c06\u201c+\/\u201d\u6539\u4e3a\u201c<\/em>-\u201d\u6216\u201c.<em>\u201d\uff08\u7528\u4f5c\u7f16\u7a0b\u8bed\u8a00\u4e2d\u7684\u6807\u8bc6\u7b26\u540d\u79f0\uff09\u6216\u201c.-\u201d\uff08\u7528\u4e8eXML\u4e2d\u7684Nmtoken\uff09\u751a\u81f3\u201c<\/em>:\u201d\uff08\u7528\u4e8eXML\u4e2d\u7684Name\uff09\u3002<\/li>\n<li>\u6700\u540e\uff1a<br \/>\n\u300b\u300b\u300b\u8fd9\u662f\u4e00\u4e2a\u80fd\u5728\u7ebf\u5bf9base64\u8fdb\u884c\u52a0\u5bc6\u89e3\u5bc6\u7684\u7f51\u7ad9<a href=\"http:\/\/tool.oschina.net\/encrypt?type=3\" title=\"\u5728\u7ebf\u52a0\u5bc6\u89e3\u5bc6(\u91c7\u7528Crypto-JS\u5b9e\u73b0)\">\u5728\u7ebf\u52a0\u5bc6\u89e3\u5bc6(\u91c7\u7528Crypto-JS\u5b9e\u73b0)<\/a><\/li>\n<\/ul>\n<h5>\u9644\u5e26\u6211\u7684\u5173\u4e8ebase64\u7684\u4e09\u7bc7\u6587\u7ae0<\/h5>\n<p>\u300b\u300b\u300b<a href=\"http:\/\/www.rainweb.site\/index.php\/2017\/02\/04\/python-article0016\/\" title=\"Python\u5b9e\u73b0Base64\u52a0\u5bc6\u548c\u89e3\u5bc6\">Python\u5b9e\u73b0Base64\u52a0\u5bc6\u548c\u89e3\u5bc6<\/a><br \/>\n\u300b\u300b\u300b<a href=\"http:\/\/www.rainweb.site\/index.php\/2017\/02\/03\/java-article0014\/\" title=\"java\u4e2d\u4f7f\u7528Base64\u52a0\u5bc6\u89e3\u5bc6\u7684\u51fd\u6570\">java\u4e2d\u4f7f\u7528Base64\u52a0\u5bc6\u89e3\u5bc6\u7684\u51fd\u6570<\/a><br \/>\n\u300b\u300b\u300b<a href=\"http:\/\/www.rainweb.site\/index.php\/2017\/02\/04\/php-article0016\/\" title=\"PHP\u5b9e\u73b0base64\u52a0\u5bc6\u548c\u89e3\u5bc6\u7684\u65b9\u6cd5\">PHP\u5b9e\u73b0base64\u52a0\u5bc6\u548c\u89e3\u5bc6\u7684\u65b9\u6cd5<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5e73\u65f6\u7ecf\u5e38\u4f1a\u7528\u5230base64\u7f16\u7801\u6765\u52a0\u5bc6\u6216\u8005\u89e3\u5bc6\u6570\u636e\uff0c\u5728java\uff0cphp\uff0cpython\u4e2d\u90fd\u5199\u8fc7\u5173\u4e8e\u600e\u6837\u4f7f\u7528\u7684bas\u2026 <span class=\"read-more\"><a href=\"http:\/\/rain1024.com\/index.php\/2017\/02\/03\/base-article15\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":339,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"footnotes":""},"categories":[18],"tags":[38,85],"class_list":["post-334","post","type-post","status-publish","format-aside","has-post-thumbnail","hentry","category-technique","tag-base","tag-code","post_format-post-format-aside"],"_links":{"self":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts\/334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/comments?post=334"}],"version-history":[{"count":0,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts\/334\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/media\/339"}],"wp:attachment":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/media?parent=334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/categories?post=334"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/tags?post=334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}