2017 © Pedro Peláez
 

library nbase

Convert numbers between arbitrary notations

image

mindplay/nbase

Convert numbers between arbitrary notations

  • Monday, August 15, 2016
  • by mindplay.dk
  • Repository
  • 1 Watchers
  • 1 Stars
  • 29 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

mindplay/nbase

This script provides a converter between numbers encoded with n-base notation., (*1)

PHP Version Build Status, (*2)

Usage

Any notation (using ASCII characters) can be used., (*3)

For example, to convert from decimal to hexadecimal notation:, (*4)

$converter = new NBaseConverter();

echo $converter->convert('12345', 'dec', 'hex'); // => '3039'

You can define your custom notations via the public $notations property - the notation names supplied to the convert method must be defined in $notation., (*5)

Common notations such as bin, hex, dec and oct are pre-defined, as well as base62 and base64, plus a URL-safe variation of base64 called url64 which uses - and _ instead of the standard + and / used by base64., (*6)

Also, a useful notation legible is available, which excludes visually ambiguous characters such as 1 and l, 0 and O, which can be used to shorten numeric IDs, e.g. for use in URLs., (*7)

Refer to the source code for a list of pre-defined notations., (*8)

The Versions

15/08 2016

dev-master

9999999-dev

Convert numbers between arbitrary notations

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

15/08 2016

1.0.0

1.0.0.0

Convert numbers between arbitrary notations

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires