negasus/numeral-system

1.0 2017-02-12 23:03 UTC

This package is not auto-updated.

Last update: 2024-11-10 01:26:13 UTC


README

Latest Version on Packagist Software License Build Status Total Downloads

Code and decode numbers with any numeral system.

Bin, Hex, your numeral systems with custom alphabet!

More info in the wiki

Structure

src/
tests/
vendor/

Install

Via Composer

$ composer require negasus/numeralsystem

Usage

$numeralSystem = new Negasus\NumeralSystem(); // Default alphabet
echo $numeralSystem->encode(1048576); // see: 4OmW

$numeralSystem->setAlphabet($numeralSystem::ALPHABET_HEX);
echo $numeralSystem->encode(172224397); // see: A43EF8D

$numeralSystem->setAlphabet('AbCd');
echo $numeralSystem->encode(172224397); // see: CCbAAddCddCAdb

More info in the wiki

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

License

The MIT License (MIT). Please see License File for more information.