Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spenserblack/anybase
Convert bytes into base-n
https://github.com/spenserblack/anybase
base64 binary go golang hexadecimal octal
Last synced: 24 days 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 (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-07T23:18:55.000Z (almost 3 years ago)
- Last Synced: 2024-10-13T16:47:43.753Z (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
[![Go Reference](https://pkg.go.dev/badge/github.com/spenserblack/anybase.svg)](https://pkg.go.dev/github.com/spenserblack/anybase)
[![Go Report Card](https://goreportcard.com/badge/github.com/spenserblack/anybase)](https://goreportcard.com/report/github.com/spenserblack/anybase)
[![CI](https://github.com/spenserblack/anybase/actions/workflows/ci.yml/badge.svg)](https://github.com/spenserblack/anybase/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/spenserblack/anybase/branch/main/graph/badge.svg?token=05dxpMxxTg)](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.