| Recommend this page to a friend! | 
|  Download | 
| Info | Documentation |  Files |  Install with Composer |  Download | Reputation | Support forum | Blog | Links | 
| Ratings | Unique User Downloads | Download Rankings | ||||
| Not yet rated by the users | Total: 58 | All time:  10,551 This week: 206  | ||||
| Version | License | PHP version | Categories | |||
| baseconverter 1.0 | MIT/X Consortium ... | 5 | PHP 5, Text processing, Conversion | 
| Description | Author | ||||||||||||||||||||||
| This package can convert number representations between two bases. | 
 | ||||||||||||||||||||||
BaseConverter is a simple and small library to convert interger values to different other bases and back.
Just run the following command in your project root:
composer require neoblack/base-converter:~1.0
<?php
require_once 'vendor/autoload.php';
use NeoBlack\BaseConverter\BaseConverter;
$number = 100;
$base64Number = BaseConverter::toBase($number, BaseConverter::BASE64); // Result: 1A
$base62Number = BaseConverter::toBase($number, BaseConverter::BASE62); // Result: 1C
$base32Number = BaseConverter::toBase($number, BaseConverter::BASE32); // Result: 34
$base16Number = BaseConverter::toBase($number, BaseConverter::BASE16); // Result: 64
BaseConverter::to10Base($base64Number, BaseConverter::BASE64); // Result: 100
BaseConverter::to10Base($base62Number, BaseConverter::BASE62); // Result: 100
BaseConverter::to10Base($base32Number, BaseConverter::BASE32); // Result: 100
BaseConverter::to10Base($base16Number, BaseConverter::BASE16); // Result: 100
If you want to contribute, fork this repository and send a pull request.
./bin/phpunit -c Build/UnitTests.xml
rm -rf docs
./bin/phpunit -c Build/UnitTests.xml --coverage-html docs
The MIT License (MIT) see license file.
|  Files (35) | 
| File | Role | Description | ||
|---|---|---|---|---|
|  .github (2 files) | ||||
|  Build (2 files) | ||||
|  docs (3 files, 5 directories) | ||||
|  src (2 directories) | ||||
|    .travis.yml | Data | Auxiliary data | ||
|    composer.json | Data | Auxiliary data | ||
|    composer.lock | Data | Auxiliary data | ||
|    LICENSE | Lic. | License text | ||
|    README.md | Doc. | Documentation | ||
|  Files (35) | / | .github | 
| File | Role | Description | 
|---|---|---|
|    ISSUE_TEMPLATE.md | Data | Auxiliary data | 
|    PULL_REQUEST_TEMPLATE.md | Data | Auxiliary data | 
|  Files (35) | / | Build | 
| File | Role | Description | 
|---|---|---|
|    UnitTests.xml | Data | Auxiliary data | 
|    UnitTestsBootstrap.php | Class | Class source | 
|  Files (35) | / | docs | 
| File | Role | Description | ||
|---|---|---|---|---|
|  Classes (3 files) | ||||
|  css (3 files) | ||||
|  fonts (1 file) | ||||
|  js (7 files) | ||||
|  Tests (2 files, 1 directory) | ||||
|    BaseConverter.php.html | Doc. | Documentation | ||
|    dashboard.html | Doc. | Documentation | ||
|    index.html | Doc. | Documentation | ||
|  Files (35) | / | docs | / | Classes | 
| File | Role | Description | 
|---|---|---|
|    BaseConverter.php.html | Doc. | Documentation | 
|    dashboard.html | Doc. | Documentation | 
|    index.html | Doc. | Documentation | 
|  Files (35) | / | docs | / | css | 
| File | Role | Description | 
|---|---|---|
|    bootstrap.min.css | Data | Auxiliary data | 
|    nv.d3.min.css | Data | Auxiliary data | 
|    style.css | Data | Auxiliary data | 
|  Files (35) | / | docs | / | fonts | 
| File | Role | Description | 
|---|---|---|
|    glyphicons-halflings-regular.svg | Data | Auxiliary data | 
|  Files (35) | / | docs | / | js | 
| File | Role | Description | 
|---|---|---|
|    bootstrap.min.js | Data | Auxiliary data | 
|    d3.min.js | Data | Auxiliary data | 
|    holder.min.js | Data | Auxiliary data | 
|    html5shiv.min.js | Data | Auxiliary data | 
|    jquery.min.js | Data | Auxiliary data | 
|    nv.d3.min.js | Data | Auxiliary data | 
|    respond.min.js | Data | Auxiliary data | 
|  Files (35) | / | docs | / | Tests | 
| File | Role | Description | ||
|---|---|---|---|---|
|  Unit (4 files) | ||||
|    dashboard.html | Doc. | Documentation | ||
|    index.html | Doc. | Documentation | ||
|  Files (35) | / | docs | / | Tests | / | Unit | 
| File | Role | Description | 
|---|---|---|
|    BaseConverterTest.php.html | Doc. | Documentation | 
|    BaseTestCase.php.html | Doc. | Documentation | 
|    dashboard.html | Doc. | Documentation | 
|    index.html | Doc. | Documentation | 
|  Files (35) | / | src | / | Tests | / | Unit | 
| File | Role | Description | 
|---|---|---|
|    BaseConverterTest.php | Class | Class source | 
|    BaseTestCase.php | Class | Class source | 
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. | 
|  Install with Composer | 
| Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
| 100% | 
 | 
 | 
| Applications that use this package | 
 If you know an application of this package, send a message to the author to add a link here.
 If you know an application of this package, send a message to the author to add a link here.