6.3.0 - 新增 ocr / notice / s13n / Color 模块; 新增前台时保持屏幕常亮; 修复构建脚本依赖; 修复并优化控制台浮动窗口
This commit is contained in:
@@ -2,10 +2,12 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Base64 | AutoJs6 文档 - 6.2.0</title>
|
||||
<title>Base64 | AutoJs6 文档 - 6.3.0</title>
|
||||
<link rel="stylesheet" href="assets/fonts.css">
|
||||
<link rel="stylesheet" href="assets/style.css">
|
||||
<link rel="stylesheet" href="assets/sh.css">
|
||||
<link rel="stylesheet" href="plugins/docsify-copy-code@2-styles.css">
|
||||
<link rel="stylesheet" href="plugins/zoom-image-styles.css">
|
||||
<link rel="canonical" href="https://nodejs.org/api/base64.html">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<meta name="viewport" content="user-scalable=no">
|
||||
@@ -21,15 +23,14 @@
|
||||
<ul>
|
||||
<li><a class="nav-overview" href="overview.html">Overview - 综述</a></li>
|
||||
<li><a class="nav-documentation" href="documentation.html">About - 关于文档</a></li>
|
||||
<li><a class="nav-progress" href="progress.html">Progress - 完善进度</a></li>
|
||||
<li><a class="nav-changelog" href="changelog.html">Changelog - 更新日志</a></li>
|
||||
<li><a class="nav-qa" href="qa.html">Q&A - 疑难解答</a></li>
|
||||
<li><a class="nav-progress" href="progress.html">Progress - 文档部署进度</a></li>
|
||||
<li><a class="nav-changelog" href="changelog.html">Changelog - 文档更新日志</a></li>
|
||||
</ul>
|
||||
<div class="line"></div>
|
||||
|
||||
<ul>
|
||||
<li><a class="nav-https-developer-mozilla-org-zh-CN-docs-Web-JavaScript-" href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/">MDN - JavaScript 基础</a></li>
|
||||
<li><a class="nav-https-zh-javascript-info-" href="https://zh.javascript.info/">JavaScript.info - JavaScript 教程</a></li>
|
||||
<li><a class="nav-manual" href="manual.html">Manual - AutoJs6 使用手册</a></li>
|
||||
<li><a class="nav-qa" href="qa.html">Q & A - 疑难解答</a></li>
|
||||
</ul>
|
||||
<div class="line"></div>
|
||||
|
||||
@@ -40,6 +41,7 @@
|
||||
<li><a class="nav-app" href="app.html">App - 通用应用</a></li>
|
||||
<li><a class="nav-color" href="color.html">Color - 颜色</a></li>
|
||||
<li><a class="nav-image" href="image.html">Image - 图像</a></li>
|
||||
<li><a class="nav-ocr" href="ocr.html">OCR - 光学字符识别</a></li>
|
||||
<li><a class="nav-keys" href="keys.html">Keys - 按键</a></li>
|
||||
<li><a class="nav-device" href="device.html">Device - 设备</a></li>
|
||||
<li><a class="nav-storages" href="storages.html">Storage - 储存</a></li>
|
||||
@@ -48,6 +50,8 @@
|
||||
<li><a class="nav-tasks" href="tasks.html">Task - 任务</a></li>
|
||||
<li><a class="nav-modules" href="modules.html">Module - 模块</a></li>
|
||||
<li><a class="nav-plugins" href="plugins.html">Plugins - 插件</a></li>
|
||||
<li><a class="nav-toast" href="toast.html">Toast - 消息浮动框</a></li>
|
||||
<li><a class="nav-notice" href="notice.html">Notice - 消息通知</a></li>
|
||||
<li><a class="nav-console" href="console.html">Console - 控制台</a></li>
|
||||
<li><a class="nav-shell" href="shell.html">Shell</a></li>
|
||||
<li><a class="nav-media" href="media.html">Media - 多媒体</a></li>
|
||||
@@ -66,12 +70,28 @@
|
||||
<li><a class="nav-base64 active" href="base64.html">Base64</a></li>
|
||||
<li><a class="nav-crypto" href="crypto.html">Crypto - 密文</a></li>
|
||||
<li><a class="nav-i18n" href="i18n.html">Internationalization - 国际化</a></li>
|
||||
<li><a class="nav-s13n" href="s13n.html">Standardization - 标准化</a></li>
|
||||
<li><a class="nav-e4x" href="e4x.html">E4X</a></li>
|
||||
</ul>
|
||||
<div class="line"></div>
|
||||
|
||||
<ul>
|
||||
<li><a class="nav-glossaries" href="glossaries.html">Glossaries - 术语</a></li>
|
||||
<li><a class="nav-uiSelectorType" href="uiSelectorType.html">UiSelector - 选择器</a></li>
|
||||
<li><a class="nav-uiObjectType" href="uiObjectType.html">UiObject - 控件节点</a></li>
|
||||
<li><a class="nav-uiObjectCollectionType" href="uiObjectCollectionType.html">UiObjectCollection - 控件集合</a></li>
|
||||
<li><a class="nav-uiObjectActionsType" href="uiObjectActionsType.html">UiObjectActions - 控件节点行为</a></li>
|
||||
<li><a class="nav-imageWrapper" href="imageWrapper.html">ImageWrapper - 包装图像类</a></li>
|
||||
<li><a class="nav-appType" href="appType.html">App - 应用枚举类</a></li>
|
||||
<li><a class="nav-colorType" href="colorType.html">Color - 颜色类</a></li>
|
||||
<li><a class="nav-versionType" href="versionType.html">Version - 版本工具类</a></li>
|
||||
<li><a class="nav-polyfill" href="polyfill.html">Polyfill - 代码填泥</a></li>
|
||||
<li><a class="nav-arrayx" href="arrayx.html">Arrayx - Array 扩展</a></li>
|
||||
<li><a class="nav-numberx" href="numberx.html">Numberx - Number 扩展</a></li>
|
||||
<li><a class="nav-mathx" href="mathx.html">Mathx - Math 扩展</a></li>
|
||||
</ul>
|
||||
<div class="line"></div>
|
||||
|
||||
<ul>
|
||||
<li><a class="nav-exceptions" href="exceptions.html">Exceptions - 异常</a></li>
|
||||
<li><a class="nav-intentType" href="intentType.html">Intent - 意图</a></li>
|
||||
<li><a class="nav-runtime" href="runtime.html">Runtime - 运行时</a></li>
|
||||
@@ -80,25 +100,6 @@
|
||||
</ul>
|
||||
<div class="line"></div>
|
||||
|
||||
<ul>
|
||||
<li><a class="nav-dataTypes" href="dataTypes.html">Data Types - 数据类型</a></li>
|
||||
<li><a class="nav-uiSelectorType" href="uiSelectorType.html">UiSelector - 选择器</a></li>
|
||||
<li><a class="nav-uiObjectType" href="uiObjectType.html">UiObject - 控件节点</a></li>
|
||||
<li><a class="nav-uiObjectCollectionType" href="uiObjectCollectionType.html">UiObjectCollection - 控件集合</a></li>
|
||||
<li><a class="nav-uiObjectActionsType" href="uiObjectActionsType.html">UiObjectActions - 控件节点行为</a></li>
|
||||
<li><a class="nav-appType" href="appType.html">App - 应用枚举类</a></li>
|
||||
<li><a class="nav-versionType" href="versionType.html">Version - 版本工具类</a></li>
|
||||
</ul>
|
||||
<div class="line"></div>
|
||||
|
||||
<ul>
|
||||
<li><a class="nav-polyfill" href="polyfill.html">Polyfill - 代码填泥</a></li>
|
||||
<li><a class="nav-arrayx" href="arrayx.html">Arrayx - Array 扩展</a></li>
|
||||
<li><a class="nav-numberx" href="numberx.html">Numberx - Number 扩展</a></li>
|
||||
<li><a class="nav-mathx" href="mathx.html">Mathx - Math 扩展</a></li>
|
||||
</ul>
|
||||
<div class="line"></div>
|
||||
|
||||
<ul>
|
||||
<li><a class="nav-scriptingJava" href="scriptingJava.html">Scripting Java - 脚本化 Java</a></li>
|
||||
<li><a class="nav-apiLevel" href="apiLevel.html">Android API Level - 安卓 API 级别</a></li>
|
||||
@@ -107,15 +108,51 @@
|
||||
<div class="line"></div>
|
||||
|
||||
<ul>
|
||||
<li><a class="nav-https-github-com-SuperMonster003-AutoJs6-" href="https://github.com/SuperMonster003/AutoJs6/">GitHub - 应用项目地址</a></li>
|
||||
<li><a class="nav-https-github-com-SuperMonster003-AutoJs6-Documentation" href="https://github.com/SuperMonster003/AutoJs6-Documentation">GitHub - 文档项目地址</a></li>
|
||||
<li><a class="nav-glossaries" href="glossaries.html">Glossaries - 术语</a></li>
|
||||
<li><a class="nav-httpHeaderGlossary" href="httpHeaderGlossary.html">HttpHeader - HTTP 标头</a></li>
|
||||
<li><a class="nav-httpRequestMethodsGlossary" href="httpRequestMethodsGlossary.html">HttpRequestMethods - HTTP 请求方法</a></li>
|
||||
<li><a class="nav-mimeTypeGlossary" href="mimeTypeGlossary.html">MimeType - MIME 类型</a></li>
|
||||
<li><a class="nav-notificationChannelGlossary" href="notificationChannelGlossary.html">NotificationChannel - 通知渠道</a></li>
|
||||
</ul>
|
||||
<div class="line"></div>
|
||||
|
||||
<ul>
|
||||
<li><a class="nav-dataTypes" href="dataTypes.html">Data Types - 数据类型</a></li>
|
||||
<li><a class="nav-omniTypes" href="omniTypes.html">Omnipotent Types - 全能类型</a></li>
|
||||
<li><a class="nav-storageType" href="storageType.html">Storage - 存储类</a></li>
|
||||
<li><a class="nav-androidBundleType" href="androidBundleType.html">AndroidBundle</a></li>
|
||||
<li><a class="nav-androidRectType" href="androidRectType.html">AndroidRect</a></li>
|
||||
<li><a class="nav-consoleBuildOptionsType" href="consoleBuildOptionsType.html">ConsoleBuildOptions</a></li>
|
||||
<li><a class="nav-httpRequestBuilderOptionsType" href="httpRequestBuilderOptionsType.html">HttpRequestBuilderOptions</a></li>
|
||||
<li><a class="nav-httpRequestHeadersType" href="httpRequestHeadersType.html">HttpRequestHeaders</a></li>
|
||||
<li><a class="nav-httpResponseBodyType" href="httpResponseBodyType.html">HttpResponseBody</a></li>
|
||||
<li><a class="nav-httpResponseHeadersType" href="httpResponseHeadersType.html">HttpResponseHeaders</a></li>
|
||||
<li><a class="nav-httpResponseType" href="httpResponseType.html">HttpResponse</a></li>
|
||||
<li><a class="nav-injectableWebClientType" href="injectableWebClientType.html">InjectableWebClient</a></li>
|
||||
<li><a class="nav-injectableWebViewType" href="injectableWebViewType.html">InjectableWebView</a></li>
|
||||
<li><a class="nav-noticeOptionsType" href="noticeOptionsType.html">NoticeOptions</a></li>
|
||||
<li><a class="nav-noticeChannelOptionsType" href="noticeChannelOptionsType.html">NoticeChannelOptions</a></li>
|
||||
<li><a class="nav-noticePresetConfigurationType" href="noticePresetConfigurationType.html">NoticePresetConfiguration</a></li>
|
||||
<li><a class="nav-noticeBuilderType" href="noticeBuilderType.html">NoticeBuilder</a></li>
|
||||
<li><a class="nav-okhttp3HttpUrlType" href="okhttp3HttpUrlType.html">Okhttp3HttpUrl</a></li>
|
||||
<li><a class="nav-ocrOptionsType" href="ocrOptionsType.html">OcrOptions</a></li>
|
||||
<li><a class="nav-okhttp3RequestType" href="okhttp3RequestType.html">Okhttp3Request</a></li>
|
||||
<li><a class="nav-opencvPointType" href="opencvPointType.html">OpencvPoint</a></li>
|
||||
<li><a class="nav-opencvRectType" href="opencvRectType.html">OpencvRect</a></li>
|
||||
<li><a class="nav-opencvSizeType" href="opencvSizeType.html">OpencvSize</a></li>
|
||||
</ul>
|
||||
<div class="line"></div>
|
||||
|
||||
<ul>
|
||||
<li><a class="nav-http-project-autojs6-com" href="http://project.autojs6.com">GitHub - 应用项目地址</a></li>
|
||||
<li><a class="nav-http-docs-project-autojs6-com" href="http://docs-project.autojs6.com">GitHub - 文档项目地址</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="column1" data-id="base64" class="interior">
|
||||
<header>
|
||||
<h1>AutoJs6 文档 - 6.2.0</h1>
|
||||
<h1>AutoJs6 文档 - 6.3.0</h1>
|
||||
<div id="gtoc">
|
||||
<p class="index">
|
||||
<a href="index.html" name="toc">索引</a> |
|
||||
@@ -128,29 +165,97 @@
|
||||
<div id="toc">
|
||||
<h2>目录</h2>
|
||||
<ul>
|
||||
<li><span class="stability_undefined"><a href="#base64_base64">Base64</a></span></li>
|
||||
<li><span class="stability_undefined"><a href="#base64_base64">Base64</a></span><ul>
|
||||
<li><span class="stability_undefined"><a href="#base64">可逆性</a></span></li>
|
||||
<li><span class="stability_undefined"><a href="#base64_m_encode">[m] encode</a></span><ul>
|
||||
<li><span class="stability_undefined"><a href="#base64_encode_str_encoding">encode(str, encoding?)</a></span></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><span class="stability_undefined"><a href="#base64_m_decode">[m] decode</a></span><ul>
|
||||
<li><span class="stability_undefined"><a href="#base64_decode_str_encoding">decode(str, encoding?)</a></span></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="apicontent">
|
||||
<h1>Base64<span><a class="mark" href="#base64_base64" id="base64_base64">#</a></span></h1>
|
||||
<p>Base64 是一种编码方式, 同时可作为一种数据的存储格式, 并非严格意义上的加密与解密.</p>
|
||||
<p>base64 模块主要用于对数据进行 Base64 编码及解码.</p>
|
||||
<blockquote>
|
||||
<p>注: 与 <a href="crypto.html">crypto</a> 模块不同, crypto 模块主要用于信息的加密与解密.</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>参阅:<br><a href="https://en.wikipedia.org/wiki/Base64">Wikipedia (英)</a> / <a href="https://zh.wikipedia.org/wiki/Base64">Wikipedia (中)</a><br><a href="http://www.ruanyifeng.com/blog/2008/06/base64.html">Base64 笔记 (from 阮一峰的网络日志)</a><br><a href="https://juejin.cn/post/6887498543494660109">Base64 是加密算法吗 (from 稀土掘金)</a></p>
|
||||
</blockquote>
|
||||
<h2>可逆性<span><a class="mark" href="#base64" id="base64">#</a></span></h2>
|
||||
<p>Base64 是一种可逆的编码方式:</p>
|
||||
<pre><code class="lang-js">base64.decode(base64.encode('orange')); // orange
|
||||
base64.decode(base64.encode('简体中文')); // 简体中文
|
||||
</code></pre>
|
||||
<p>但需注意参数的字符编码方式 (默认为 <code>UTF-8</code>), 当存在超出编码表示范围的字符时, 可逆性将遭到破坏:</p>
|
||||
<pre><code class="lang-js">/* us-ascii 编码无法表示 "出" 和 "口". */
|
||||
base64.decode(base64.encode('E2 出口', 'us-ascii'), 'us-ascii'); // E2 ??
|
||||
</code></pre>
|
||||
<p>编解码使用了不同的编码方式, 也可能导致可逆性失效:</p>
|
||||
<pre><code class="lang-js">/* utf-16 与 utf-8 不一致. */
|
||||
base64.decode(base64.encode('简体中文', 'utf-16'), 'utf-8'); // <20><>{<7B>OSN-e<>
|
||||
</code></pre>
|
||||
<hr>
|
||||
<p style="font: italic 1em sans-serif; color: #78909C">此章节待补充或完善...</p>
|
||||
<p style="font: italic 1em sans-serif; color: #78909C">Marked by SuperMonster003 on Oct 22, 2022.</p>
|
||||
<p style="font: bold 2em sans-serif; color: #FF7043">base64</p>
|
||||
|
||||
<hr>
|
||||
<h2>[m] encode<span><a class="mark" href="#base64_m_encode" id="base64_m_encode">#</a></span></h2>
|
||||
<h3>encode(str, encoding?)<span><a class="mark" href="#base64_encode_str_encoding" id="base64_encode_str_encoding">#</a></span></h3>
|
||||
<div class="signature"><ul>
|
||||
<li><strong>str</strong> { <span class="type"><a href="dataTypes.html#datatypes_string">string</a></span> } - 待编码字符串</li>
|
||||
<li><strong>[ encoding = <code>'UTF_8'</code> ]</strong> { <span class="type"><a href="dataTypes.html#datatypes_standardcharset">StandardCharset</a></span> } - 字符编码</li>
|
||||
<li><ins><strong>returns</strong></ins> { <span class="type"><a href="dataTypes.html#datatypes_string">string</a></span> }</li>
|
||||
</ul>
|
||||
</div><p>对字符串进行 Base64 编码.</p>
|
||||
<pre><code class="lang-js">base64.encode('hello', 'iso-8859-1'); // aGVsbG8=
|
||||
base64.encode('hello', 'us-ascii'); // aGVsbG8=
|
||||
base64.encode('hello', 'utf-8'); // aGVsbG8=
|
||||
base64.encode('hello', 'utf-16'); // /v8AaABlAGwAbABv
|
||||
base64.encode('hello', 'utf-16be'); // AGgAZQBsAGwAbw==
|
||||
base64.encode('hello', 'utf-16le'); // aABlAGwAbABvAA==
|
||||
</code></pre>
|
||||
<h2>[m] decode<span><a class="mark" href="#base64_m_decode" id="base64_m_decode">#</a></span></h2>
|
||||
<h3>decode(str, encoding?)<span><a class="mark" href="#base64_decode_str_encoding" id="base64_decode_str_encoding">#</a></span></h3>
|
||||
<div class="signature"><ul>
|
||||
<li><strong>str</strong> { <span class="type"><a href="dataTypes.html#datatypes_string">string</a></span> } - 待解码字符串</li>
|
||||
<li><strong>[ encoding = <code>'UTF_8'</code> ]</strong> { <span class="type"><a href="dataTypes.html#datatypes_standardcharset">StandardCharset</a></span> } - 字符编码</li>
|
||||
<li><ins><strong>returns</strong></ins> { <span class="type"><a href="dataTypes.html#datatypes_string">string</a></span> }</li>
|
||||
</ul>
|
||||
</div><p>对字符串进行 Base64 解码.</p>
|
||||
<pre><code class="lang-js">base64.decode('aGVsbG8=', 'iso-8859-1'); // hello
|
||||
base64.decode('aGVsbG8=', 'us-ascii'); // hello
|
||||
base64.decode('aGVsbG8=', 'utf-8'); // hello
|
||||
base64.decode('/v8AaABlAGwAbABv', 'utf-16'); // hello
|
||||
base64.decode('AGgAZQBsAGwAbw==', 'utf-16be'); // hello
|
||||
base64.decode('aABlAGwAbABvAA==', 'utf-16le'); // hello
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="assets/sh_javascript.js"></script>
|
||||
<script src="assets/sh_java.js"></script>
|
||||
<script src="assets/sh_main.js"></script>
|
||||
|
||||
<script src="plugins/docsify-copy-code@2.js"></script>
|
||||
<script src="plugins/zoom-image.js"></script>
|
||||
|
||||
<script>
|
||||
highlight(void 0, void 0, 'pre');
|
||||
highlight(void 0, void 0, 'tt');
|
||||
</script>
|
||||
|
||||
<!-- __TRACKING__ -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user