https://github.com/bddjr/base128
Smaller than Base64, only use ASCII, can run in web browser.
https://github.com/bddjr/base128
ascii base128 base64 javascript js ts typescript
Last synced: about 2 months ago
JSON representation
Smaller than Base64, only use ASCII, can run in web browser.
- Host: GitHub
- URL: https://github.com/bddjr/base128
- Owner: bddjr
- License: unlicense
- Created: 2025-01-07T13:49:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-03-29T00:04:23.000Z (2 months ago)
- Last Synced: 2026-04-02T10:36:23.598Z (2 months ago)
- Topics: ascii, base128, base64, javascript, js, ts, typescript
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/base128-ascii
- Size: 1.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Smaller than base64, only use ASCII, can run in web browser.
Build for [vite-plugin-singlefile-compression](https://github.com/bddjr/vite-plugin-singlefile-compression)
## Setup
### npm
```
npm i base128-ascii
```
```js
import base128 from "base128-ascii"
import fs from "fs"
const encodedTemplate = base128.encode(fs.readFileSync("example.gz")).toJSTemplateLiterals()
const decoded = base128.decode(eval(encodedTemplate))
```
---
## Effect
Encode this jpg file, use base128 is `109.85 KiB` smaller than base64:
```
screenshot-45.519.jpg
file length: 682086
base128:
toJSTemplateLiterals length: 796961
equal: true
base64:
encoded length: 909448
```