{"id":924,"date":"2020-11-24T13:58:46","date_gmt":"2020-11-24T05:58:46","guid":{"rendered":"https:\/\/badgameshow.com\/fly\/?p=924"},"modified":"2021-04-28T14:46:20","modified_gmt":"2021-04-28T06:46:20","slug":"android-base64%e5%8a%a0%e5%af%86%e8%a7%a3%e5%af%86","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/fly\/android-base64%e5%8a%a0%e5%af%86%e8%a7%a3%e5%af%86\/","title":{"rendered":"Util Base64\u52a0\u5bc6\u89e3\u5bc6"},"content":{"rendered":"<h4>1.Base64\u5de5\u5177\u985e<\/h4>\n<pre><code class=\"language-Kotlin line-numbers\">object Base64Util {\n    fun decode(str: String) = String(Base64.decode(str, Base64.DEFAULT))\n    fun encode(str: String) = String(Base64.encode(str.toByteArray(), Base64.DEFAULT))\n}\n<\/code><\/pre>\n<h4>2.\u6548\u679c\u5c55\u793a<\/h4>\n<pre><code class=\"language-Kotlin line-numbers\">val encode = Base64Util.encode(\"\u4f60\u597d \u6211\u662fBase64\")\nLog.e(\"Base64 encode:\", encode)\nval decode = Base64Util.decode(\"5L2g5aW9IOaIkeaYr0Jhc2U2NA==\")\nLog.e(\"Base64 decode:\", decode)\n<\/code><\/pre>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2020\/11\/1606197485948.jpg\"><img decoding=\"async\" src=\"https:\/\/badgameshow.com\/fly\/wp-content\/uploads\/2020\/11\/1606197485948-300x45.jpg\" alt=\"\" \/><\/a><\/p>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>1.Base64\u5de5\u5177\u985e object Base64Util { fun decode(str: String) &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[9],"tags":[148,15,16],"class_list":["post-924","post","type-post","status-publish","format-standard","hentry","category-util","tag-base64","tag-kotlin","tag-util"],"_links":{"self":[{"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/posts\/924","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/comments?post=924"}],"version-history":[{"count":2,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/posts\/924\/revisions"}],"predecessor-version":[{"id":1343,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/posts\/924\/revisions\/1343"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/media?parent=924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/categories?post=924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/fly\/wp-json\/wp\/v2\/tags?post=924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}