https://github.com/spenserblack/anybase
Convert bytes into base-n
https://github.com/spenserblack/anybase
base64 binary go golang hexadecimal octal
Last synced: 2 months ago
JSON representation
Convert bytes into base-n
- Host: GitHub
- URL: https://github.com/spenserblack/anybase
- Owner: spenserblack
- License: mit
- Created: 2022-03-05T03:45:29.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-07T23:18:55.000Z (about 3 years ago)
- Last Synced: 2025-03-08T18:13:11.849Z (2 months ago)
- Topics: base64, binary, go, golang, hexadecimal, octal
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-repositories - anybase - n (Repositories)
README
# anybase
[](https://pkg.go.dev/github.com/spenserblack/anybase)
[](https://goreportcard.com/report/github.com/spenserblack/anybase)
[](https://github.com/spenserblack/anybase/actions/workflows/ci.yml)
[](https://codecov.io/gh/spenserblack/anybase)Create an arbitrary base-n encoder and decoder with any set digits, with the limit that `n` is in `[2, 256)` and that each digit
can be represented as a single byte.This does not truly allow *any* base-n, for the sake of API simplicity and familiarity based on the `encoding/hex` standard
library. Base-1 would be absurd and implemented as tallies (`1` = `1`, `2` = `11`, etc.), and Base-257+ would not be able
to be stored in a `byte`.View the examples for more details.