Base62 encoding using 62-character alphabet (A-Z, a-z, 0-9) for URL-safe, compact encoding. Commonly used in URL shortening services like bit.ly and for generating user-friendly database IDs. No padding required.
| Property | Value |
|---|---|
| Category | Encoding Schemes |
| Sub-category | Base Encoding |
| Security status | 🎓 Educational Only |
| Complexity | Beginner |
| Inventor | URL Shortening Industry |
| Year | 2000 |
| Origin | 🌐 International |
| Source | algorithms/encoding/base62.js |
Status: 🎓 Educational Only
No vulnerabilities are recorded for this implementation.
6 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.
Vector 1 — Base62 empty string test
| Field | Value |
|---|---|
input |
(empty) |
expected |
(empty) |
Vector 2 — Base62 zero byte test - maps to first alphabet character
| Field | Value |
|---|---|
input |
00 |
expected |
41 |
Vector 3 — Base62 maximum byte test - 255 in Base62
| Field | Value |
|---|---|
input |
ff |
expected |
4548 |
Vector 4 — Base62 single byte - 72 (‘H’ ASCII)
| Field | Value |
|---|---|
input |
48 |
expected |
424b |
Vector 5 — Base62 three byte array test
| Field | Value |
|---|---|
input |
010203 |
expected |
524c56 |
Vector 6 — Base62 leading zero byte test
| Field | Value |
|---|---|
input |
0001 |
expected |
4142 |