nbaser

Encode/decode arbitrary unicode bases from size 2 to 256

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License Apache-2.0
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:23

Installation

nimble install nbaser
choosenim install nbaser
git clone https://github.com/D-Nice/nbaser

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
nbaser - - - - - - -

Source

Repository https://github.com/D-Nice/nbaser
Homepage https://github.com/D-Nice/nbaser
Registry Source nimble_official

README

nbaser

nimble

tester linter GitHub deployments GitHub file size in bytes GitHub tag (latest SemVer)

Library allowing for consistent and reversible encode/decode operations between arbitrary unicode character bases. Supports bases from 2 to 256.

Install

$ nimble install nbaser

import in your project and use

import nbaser

const bs58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
echo bs58.decode("1Q2TWHE3GMdB6BZKafqwxXtWAWgFt5Jvm3")
# @[0, 252, 145, 111, 33, 58, 61, 127, 19, 105, 49, 61, 95, 163, 15, 97, 104, 249, 68, 106, 45, 17, 33, 166, 54]

Docs

Available @ https://d-nice.github.io/nbaser/

Includes examples.

Benchmark

Check the benchmarker CI task for current benchmark numbers.

or to test locally

$ nimble benchmark

Notes

This library does not support padding, such as that found in "standard" base32 and base64.

It utilizes the leading zero compression found in base58, thereby supports it and its variants, and does not require padding.

Due to the unicode support, there is quite some performance overhead relatively to just supporting ASCII. It results in up to an order of magnitude slowdown, but should still be fast enough. Check benchmarks.