https://github.com/almide/base64
Base64 encoding and decoding for Almide. Standard and URL-safe variants.
https://github.com/almide/base64
almide base64 encoding
Last synced: 3 months ago
JSON representation
Base64 encoding and decoding for Almide. Standard and URL-safe variants.
- Host: GitHub
- URL: https://github.com/almide/base64
- Owner: almide
- Created: 2026-03-29T05:26:22.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-03-29T11:41:55.000Z (3 months ago)
- Last Synced: 2026-03-29T13:48:59.245Z (3 months ago)
- Topics: almide, base64, encoding
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# almide/base64
Base64 encoding and decoding for [Almide](https://github.com/almide/almide). Pure Almide implementation supporting standard (RFC 4648) and URL-safe variants.
## Install
```bash
almide add almide/base64
```
## Usage
```almide
import base64
// Encode / Decode (standard)
let encoded = base64.encode("Hello World") // "SGVsbG8gV29ybGQ="
let decoded = base64.decode(encoded)! // "Hello World"
// URL-safe (no padding, - and _ instead of + and /)
let url_encoded = base64.encode_url("Hello World")
let url_decoded = base64.decode_url(url_encoded)!
```
### Bytes API
```almide
import base64
let encoded = base64.encode_bytes([72, 101, 108, 108, 111]) // "SGVsbG8="
let bytes = base64.decode_bytes("SGVsbG8=")! // [72, 101, 108, 108, 111]
```
## API
| Function | Signature | Description |
|---|---|---|
| `base64.encode` | `(String) -> String` | Encode string to Base64 |
| `base64.decode` | `(String) -> Result[String, String]` | Decode Base64 to string |
| `base64.encode_url` | `(String) -> String` | Encode to URL-safe Base64 (no padding) |
| `base64.decode_url` | `(String) -> Result[String, String]` | Decode URL-safe Base64 |
| `base64.encode_bytes` | `(List[Int]) -> String` | Encode byte list to Base64 |
| `base64.decode_bytes` | `(String) -> Result[List[Int], String]` | Decode Base64 to byte list |
| `base64.encode_bytes_url` | `(List[Int]) -> String` | Encode bytes to URL-safe Base64 |
| `base64.decode_bytes_url` | `(String) -> Result[List[Int], String]` | Decode URL-safe Base64 to bytes |
## License
MIT