Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

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.