开发者资源

完整的API文档、代码示例和SDK,帮助您快速集成Base64功能。

快速开始

1. 获取API密钥

注册账号后,在控制台获取您的API密钥

2. 安装SDK

使用npm、pip或go get安装对应语言的SDK

3. 调用API

使用SDK封装的方法进行编码解码操作

代码示例

// Node.js / 浏览器
const text = 'Hello World';
const encoded = Buffer.from(text).toString('base64');
const decoded = Buffer.from(encoded, 'base64').toString('utf8');

// 浏览器原生
const encoded = btoa('Hello World');
const decoded = atob('SGVsbG8gV29ybGQ=');

API接口

GET/api/v1/encode

编码文本为Base64

text: string *encoding: string
GET/api/v1/decode

解码Base64为文本

base64: string *encoding: string
POST/api/v1/file/encode

将文件编码为Base64

file: file *
POST/api/v1/file/decode

将Base64解码为文件

base64: string *filename: string *

SDK下载

Node.js SDK

适用于Node.js环境的SDK包

npm install @base64club/sdk

Python SDK

适用于Python 3.8+的SDK包

pip install base64club-sdk

Go SDK

适用于Go 1.18+的SDK包

go get github.com/base64club/sdk-go

Java SDK

适用于Java 11+的SDK包

Maven: com.base64club:sdk:1.0.0

完整API文档

查看详细的API使用说明

在线代码生成

交互式生成代码片段