返回顶部
b

base64-encodeBase64编解码

Encode or decode text using Base64, URL percent-encoding, or HTML entities. Use when the user asks to encode, decode, base64 encode, base64 decode, URL encode, URL decode, percent-encode, HTML escape, HTML unescape, convert to base64, convert from base64, or escape special characters.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
110
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

base64-encode

Base64 / URL / HTML 编码与解码器

使用 Base64、URL 百分比编码或 HTML 实体对文本进行编码或解码。所有处理均在客户端完成,无需外部调用。

输入

  • - 待编码或解码的文本字符串
  • 编码类型:base64(默认)、url 或 html
  • 方向:encode(编码,默认)或 decode(解码)

输出

  • - 转换后的字符串
  • 关于所应用的编码类型和方向的简要说明

操作说明

Base64(类型:base64)

编码:

  1. 1. 获取输入字符串。
  2. 将每个字符转换为其 UTF-8 字节序列(正确处理非 ASCII/Unicode 字符)。
  3. 使用标准字母表(A–Z、a–z、0–9、+、/)应用 Base64 编码。
  4. 使用 = 字符进行填充,使长度成为 4 的倍数。
  5. 等效算法为:btoa(unescape(encodeURIComponent(input)))。

解码:

  1. 1. 获取 Base64 编码的输入。
  2. 验证其仅包含有效的 Base64 字符(A–Z、a–z、0–9、+、/、=)。
  3. 使用以下方法解码:decodeURIComponent(escape(atob(input)))。
  4. 返回原始的 UTF-8 字符串。

URL 百分比编码(类型:url)

编码:

  1. 1. 应用 encodeURIComponent 语义:对除 A–Z a–z 0–9 - _ . ! ~ * ( ) 之外的所有字符进行编码。
  2. 空格变为 %20(而非 +)。
  3. 非 ASCII 字符先进行 UTF-8 编码,然后进行百分比转义。

解码:

  1. 1. 将每个 %XX 序列替换为对应的字节。
  2. 将得到的字节解释为 UTF-8 编码。
  3. 等效于 decodeURIComponent(input)。

HTML 实体(类型:html)

编码: 将这些字符替换为其命名的 HTML 实体:

  • - < → <
  • > → >
  • & → &
  • → "
  • → '

解码: 反向映射——将每个 HTML 实体替换为其字面字符。

选项

  • - type:base64 | url | html — 默认值:base64
  • direction:encode | decode — 默认值:encode

示例

Base64 编码:
输入:Hello, World!
输出:SGVsbG8sIFdvcmxkIQ==

Base64 编码(Unicode):
输入:Héllo
输出:SMOpbGxv

Base64 解码:
输入:SGVsbG8sIFdvcmxkIQ==
输出:Hello, World!

URL 编码:
输入:name=John Doe&city=New York
输出:name%3DJohn%20Doe%26city%3DNew%20York

URL 解码:
输入:hello%20world%21
输出:hello world!

HTML 编码:
输入:
输出:<script>alert("XSS")</script>

HTML 解码:
输入:<h1>Hello & welcome</h1>
输出:

Hello & welcome

错误处理

  • - 无效的 Base64 解码输入: 如果字符串包含 Base64 字母表之外的字符或填充不正确,报告:错误:无效的 Base64 字符串。请用户验证输入。
  • 无效的 URL 编码解码输入: 如果 %XX 序列使用了非十六进制数字或序列不完整,报告:错误:无效的 URL 编码字符串。
  • 空输入: 返回空字符串,并附注未提供任何输入。
  • 二进制/非文本数据: 警告用户 Base64 编码二进制数据需要原始字节,而原始字节无法以纯文本形式提供——建议他们使用接受文件上传的工具。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 base64-encode-1776085929 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 base64-encode-1776085929 技能

通过命令行安装

skillhub install base64-encode-1776085929

下载

⬇ 下载 base64-encode v1.0.0(免费)

文件大小: 2.08 KB | 发布时间: 2026-4-14 14:21

v1.0.0 最新 2026-4-14 14:21
- Initial release of the base64-encode skill.
- Supports encoding and decoding of text using Base64, URL percent-encoding, or HTML entities.
- Handles Unicode and non-ASCII characters correctly in Base64 and URL modes.
- Provides clear error messages for invalid input and empty input scenarios.
- Offers options to choose encoding type (`base64`, `url`, `html`) and direction (`encode`, `decode`).

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部