Base64 Toolkit
A comprehensive Base64 encoding and decoding tool for developers.
Features
- - Encode - Convert text to Base64
- Decode - Convert Base64 back to text
- URL-Safe - URL-safe Base64 encoding (+/- instead of /+)
- Image to Base64 - Convert images to Base64 data URI
Usage
CODEBLOCK0
Actions
| Action | Description |
|---|
| INLINECODE0 | Encode text to Base64 |
| INLINECODE1 |
Decode Base64 to text |
|
encode-url | URL-safe Base64 encoding |
|
decode-url | URL-safe Base64 decoding |
|
image-encode | Convert image to Base64 data URI |
Options
| Option | Type | Default | Description |
|---|
| INLINECODE5 | string | - | Input string or file path |
| INLINECODE6 |
bool | false | Treat input as file path |
Examples
CODEBLOCK1
Use Cases
- 1. API authentication - Encode credentials for Basic Auth
- Data transmission - Safely transmit binary data as text
- URL parameters - Use URL-safe Base64 in URLs
- Image embedding - Embed images in HTML/CSS as data URIs
- JWT tokens - Decode and inspect JWT payload
Current Status
Ready for testing.
Base64 工具包
面向开发者的综合性Base64编码与解码工具。
功能特性
- - 编码 - 将文本转换为Base64格式
- 解码 - 将Base64还原为文本
- URL安全 - URL安全的Base64编码(使用+/-替代/+)
- 图片转Base64 - 将图片转换为Base64数据URI
使用方法
bash
python3 skills/base64-toolkit/scripts/base64_toolkit.py <操作> [选项]
操作指令
| 操作 | 说明 |
|---|
| encode | 将文本编码为Base64 |
| decode |
将Base64解码为文本 |
| encode-url | URL安全的Base64编码 |
| decode-url | URL安全的Base64解码 |
| image-encode | 将图片转换为Base64数据URI |
选项参数
| 选项 | 类型 | 默认值 | 说明 |
|---|
| --input | 字符串 | - | 输入字符串或文件路径 |
| --file |
布尔值 | false | 将输入视为文件路径 |
使用示例
bash
编码文本
python3 skills/base64-toolkit/scripts/base64_toolkit.py encode --input Hello, World!
解码Base64
python3 skills/base64-toolkit/scripts/base64_toolkit.py decode --input SGVsbG8sIFdvcmxkIQ==
URL安全编码
python3 skills/base64-toolkit/scripts/base64_toolkit.py encode-url --input Hello+World?
URL安全解码
python3 skills/base64-toolkit/scripts/base64
toolkit.py decode-url --input SGVsbG8rV29ybGQ
图片转Base64
python3 skills/base64-toolkit/scripts/base64_toolkit.py image-encode --input /path/to/image.png
应用场景
- 1. API认证 - 为基本认证编码凭据
- 数据传输 - 安全地将二进制数据以文本形式传输
- URL参数 - 在URL中使用URL安全的Base64编码
- 图片嵌入 - 以数据URI形式在HTML/CSS中嵌入图片
- JWT令牌 - 解码并检查JWT负载
当前状态
已准备好进行测试。