No description
Find a file
D-Nice 0c989e0d95
chore(ci): lower fuzzer hang threshold
-per fuzzer run https://github.com/D-Nice/nbaser/runs/934292582 revealed that the 16k test case size threshold is too large, and that it's mostly false positives, that simply take a long time to process. Tried all the available test cases on local machine, which did not hang, they are just misidentified as hangs as afl notes them as hangs if taking too long.
2020-08-01 19:30:16 -04:00
.github chore(ci): lower fuzzer hang threshold 2020-08-01 19:30:16 -04:00
src fix: rune dec converters -> inline conversion & cast 2020-07-30 22:35:45 -04:00
tests fix: replace repr usage 2020-07-30 18:17:44 -04:00
.gitignore feat: add base2-256 encoder/decoder with unicode support 2020-01-10 18:18:44 -05:00
CHANGELOG.md chore(release): 1.0.1 2020-07-31 22:06:02 -04:00
LICENSE chore: Add LICENSE 2020-01-10 18:18:59 -05:00
nbaser.nimble chore: increment versioning to v1.0.1 2020-07-31 22:05:10 -04:00
nimdoc.cfg feat: add base2-256 encoder/decoder with unicode support 2020-01-10 18:18:44 -05:00
README.md chore(docs): readme typo fix 2020-07-31 18:54:37 -04:00

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.