Reading — step 1 of 5
Read
~1 min readThe Basics
The Base64 Alphabet
64 characters representing 6-bit values:
| Index | Char | Index | Char | Index | Char | Index | Char |
|---|---|---|---|---|---|---|---|
| 0-25 | A-Z | 26-51 | a-z | 52-61 | 0-9 | 62 | + |
| 63 | / |
Plus = for padding (NOT a value).
Standard mapping in code:
python
Why these chars? They're all ASCII printable + safe in most text contexts. The + and / are problematic in URLs (need percent-encoding) and filenames — see base64url variant later.
A faster approach: precomputed lookup tables.
python
For very fast encoding (gigabit/sec), specialized SIMD implementations exist — they look up 16 chars in parallel.
Discussion
Ask a question, share an insight, or help someone who’s stuck.
Sign in to post a comment or reply.
Loading…