https://github.com/yuhr/base256braille
The Base 256 Braille encoding in pure TypeScript.
https://github.com/yuhr/base256braille
base256 encoding-decoding typescript
Last synced: 7 months ago
JSON representation
The Base 256 Braille encoding in pure TypeScript.
- Host: GitHub
- URL: https://github.com/yuhr/base256braille
- Owner: yuhr
- License: cc0-1.0
- Created: 2025-07-25T08:14:26.000Z (7 months ago)
- Default Branch: develop
- Last Pushed: 2025-07-25T14:11:18.000Z (7 months ago)
- Last Synced: 2025-07-25T20:41:58.419Z (7 months ago)
- Topics: base256, encoding-decoding, typescript
- Language: TypeScript
- Homepage: https://deno.land/x/base256braille
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# base256braille
Tiny TypeScript modules that can encode/decode between bytes and Braille characters (`U+2800`–`U+28FF`). Each module is only 4 lines of code, as it just offsets each byte by `0x2800`.
## Usage
```typescript
import { assertEquals } from "https://esm.sh/jsr/@std/assert"
import toBase256braille from "https://deno.land/x/base256braille/toBase256braille.ts"
import fromBase256braille from "https://deno.land/x/base256braille/fromBase256braille.ts"
assertEquals(toBase256braille(Uint8Array.of(0, 1, 2, 3)), "⠀⠁⠂⠃")
assertEquals(fromBase256braille("⠀⠁⠂⠃"), Uint8Array.of(0, 1, 2, 3))
```
## Caveats
The null byte (`0x00`) is encoded as the invisible Braille character `⠀`, so it is highly recommended that a presenter appropriately delimit and markup for readers to easily recognize which parts of text are in the Base 256 Braille encoding.