phlib/base_convert
Drop-in replacement for PHP base_convert that supports arbitrarily large numbers without silent failures. Convert big numeric strings between bases (e.g., 10↔36) reliably via Phlib\base_convert, and round-trip large values correctly.
base_convert() which silently fails on numbers exceeding its limits (e.g., >19 digits in base-10). This is ideal for systems processing IDs, hashes, financial data, or blockchain-related workloads where precision is non-negotiable.Phlib\base_convert), simplifying integration. However, it replaces native PHP behavior, requiring intentional adoption to avoid unintended side effects.base_convert(), rigorous regression testing is essential to ensure backward compatibility where the native function was previously used. Edge-case testing (e.g., extremely large inputs) is critical.composer.json and plan upgrades if needed.InvalidArgumentException for invalid inputs (e.g., non-alphanumeric strings), unlike PHP’s native function which silently fails. This could break existing error-handling logic. Mitigation: Wrap calls in try-catch or validate inputs upstream.composer.json for consistency.base_convert() currently used? (e.g., user input, internal processing, legacy data migration)base_convert()? Could this package expose hidden bugs in existing logic?base_convert($x, 10, 36) → base_convert(..., 36, 10))?base_convert() behavior which may need updating?base_convert() calls?base_convert() calls.base_convert(). Mitigation:
Phlib\base_convert) to avoid conflicts.composer.json to maintain consistency:
"extra": {
"aliases": {
"base_convert": "Phlib\\base_convert"
}
}
app()->baseConvert()) to abstract the package and provide Laravel-like integration.base_convert() globally (risky, could affect dependencies).composer require phlib/base_convert
base_convert() usage:
grep -r "base_convert" app/ --include="*.php"
Categorize by criticality (e.g., security-sensitive vs. non-critical).base_convert() calls incrementally, starting with low-risk areas (e.g., logging, analytics).if (config('features.use_phlib_base_convert')) {
$result = Phlib\base_convert($number, $fromBase, $toBase);
} else {
$result = base_convert($number, $fromBase, $toBase);
}
base_convert() calls return identical results to the native function for small numbers and correct results for large numbers.base_convert() as a backup for critical paths until full confidence is achieved.InvalidArgumentException.base_convert in composer.json.base_convert() usages in the codebase.base_convert() in non-critical paths (e.g., logging, analytics).base_convert() in critical paths (e.g., security, financial data).base_convert() fallback.How can I help you explore Laravel packages today?