Skip to content

v2.0.0

Latest

Choose a tag to compare

@nabeghe nabeghe released this 27 Sep 20:48

What's Changed in v2.0.0

  • Complete Default Alphabet: Default CHARS now includes all 63 characters (0-9, A-Z, a-z, _) with dynamic base resolution.
  • Predefined Alphabet Presets: Added BASE60 (legacy sexagesimal compatibility), BASE62, BASE58 (Bitcoin style), and BASE36.
  • Arbitrary-Precision BigInt: Seamlessly handles numbers beyond PHP_INT_MAX via GMP, BCMath, or pure-PHP fallback (toBigDecimal, decode).
  • Performance Boost: Up to ~3M ops/sec using $O(1)$ memoized lookup tables and optimized string allocation.
  • New Features: Added output padding (pad, unpad), format validation (isValid), and an Object-Oriented Instance API.
  • PHP Compatibility: Full support across PHP 7.4 through PHP 8.5+ backed by a 100% passing PHPUnit test suite and CI matrix.

Upgrading from v1.x

If you need identical output to v1.x sexagesimal encoding, pass Alphanum::BASE60 as the alphabet parameter:

Alphanum::generate($number, Alphanum::BASE60);
Alphanum::toDecimal($string, Alphanum::BASE60);