2017 © Pedro Peláez
 

library radix-converter

image

volcanus/radix-converter

  • Tuesday, September 26, 2017
  • by k-holy
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,027 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 3 % Grown

The README.md

Volcanus\RadixConverter

Latest Stable Version Build Status Coverage Status, (*1)

RadixConverter

N進数への変換を行うためのクラスです。 初期設定では62進数に変換します。, (*2)

use \Volcanus\RadixConverter\RadixConverter;

$converter = new RadixConverter();
$converter->encode(62)->value(); // '10'
$converter->decode('10')->value(); // '62'

お手軽に静的コールでも使えます。, (*3)

RadixConverter::encode(62); // '10'
RadixConverter::decode('10'); // 62

16進数や36進数の変換にも対応しています。, (*4)

$converter->config('map', RadixConverter::MAP_HEXADECIMAL);
$converter->encode(65535)->value(); // 'ffff'
$converter->config('map', RadixConverter::MAP_ALPHANUMERIC_36);
$converter->encode(65535)->value(); // '1ekf'

自分で定義することもできます。(マルチバイト未対応), (*5)

$converter->config('map', 'OKNU');
$converter->encode(0)->value(); // 'O'
$converter->encode(4)->value(); // 'KO'
$converter->encode(16)->value(); // 'KOO'
$converter->encode(228)->value(); // 'UNKO'

BC Math関数を使える環境でacceptLong設定を有効にすると、PHP_INT_MAX 以上の整数値を文字列として扱えます。, (*6)

$converter->config('acceptLong', true);
$converter->encode('2147483648')->value(); // '2lkCB2'
$converter->encode('2147483648')->decode()->value(); // '2147483648'
$converter->encode('9223372036854775808')->value(); // 'aZl8N0y58M8'
$converter->encode('9223372036854775808')->decode()->value(); // '9223372036854775808'

The Versions

26/09 2017

0.5.x-dev

0.5.9999999.9999999-dev https://github.com/k-holy/volcanus-radix-converter

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

by Avatar k-holy

26/09 2017

0.5.0

0.5.0.0 https://github.com/k-holy/volcanus-radix-converter

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

The Development Requires

by Avatar k-holy

06/09 2017

dev-master

9999999-dev https://github.com/k-holy/volcanus-radix-converter

  Sources   Download

MIT

The Requires

  • php ^5.6||^7.0

 

The Development Requires

by Avatar k-holy

06/09 2017

dev-develop

dev-develop https://github.com/k-holy/volcanus-radix-converter

  Sources   Download

MIT

The Requires

  • php ^5.6||^7.0

 

The Development Requires

by Avatar k-holy

06/09 2017

1.0.1

1.0.1.0 https://github.com/k-holy/volcanus-radix-converter

  Sources   Download

MIT

The Requires

  • php ^5.6||^7.0

 

The Development Requires

by Avatar k-holy

05/09 2017

1.0.0

1.0.0.0 https://github.com/k-holy/volcanus-radix-converter

  Sources   Download

MIT

The Requires

  • php ^5.6||^7.0||^7.1

 

The Development Requires

by Avatar k-holy

16/05 2016

0.3.0

0.3.0.0 https://github.com/k-holy/volcanus-radix-converter

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

by Avatar k-holy

17/04 2015

0.2.2

0.2.2.0 https://github.com/k-holy/volcanus-radix-converter

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

by Avatar k-holy

19/03 2014

0.2.1

0.2.1.0 https://github.com/k-holy/volcanus-radix-converter

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Avatar k-holy

19/03 2014

0.2.0

0.2.0.0 https://github.com/k-holy/volcanus-radix-converter

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Avatar k-holy

25/11 2013

0.1.2

0.1.2.0 https://github.com/k-holy/volcanus-radix-converter

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

The Development Requires

by Avatar k-holy

21/10 2013

0.1.1

0.1.1.0 https://github.com/k-holy/volcanus-radix-converter

  Sources   Download

MIT

The Requires

  • php >=5.3
  • ext-bcmath *

 

by Avatar k-holy