Edit report at http://bugs.php.net/bug.php?id=53708&edit=1

 ID:                 53708
 Updated by:         [email protected]
 Reported by:        jimktrains at gmail dot com
 Summary:            base_convert could go to base 62 or 64
-Status:             Open
+Status:             Wont fix
 Type:               Feature/Change Request
-Package:            *General Issues
+Package:            Math related
 Operating System:   All
 PHP Version:        trunk-SVN-2011-01-10 (SVN)
 Block user comment: N
 Private report:     N

 New Comment:

The mapping of values to characters occurs in a different order in

"standard" Base64 to the way base_convert() currently works, so

extending base_convert() out to 64 wouldn't make much sense, since it

would either be inconsistent with the existing behaviour of

base_convert() or base64_encode(), and either way I can only see it

confusing people.



Going to 62 would be possible, but as a cursory Web search for Base62

shows, there's no real standard -- even an informal one -- for how the

character set is ordered: the most common order seems to be 0-9a-zA-Z,

but there are plenty of examples of 0-9A-Za-z as well, not to mention

implementations that are simple variants of Base64 (which is, of

course, A-Za-z0-9, then two non-alphanumeric characters that nobody

seems to be able to agree on).



While it would be nice to have a Base62 conversion function (since it

is quite useful in URLs), I don't think the PHP standard library is

the place for it at the moment; developers will be better off using an

implementation that implements the actual variant they want.



Closing won't fix.


Previous Comments:
------------------------------------------------------------------------
[2011-01-10 17:07:07] jimktrains at gmail dot com

Description:
------------
base_convert (http://php.net/manual/en/function.base-convert.php)
should/could go to base 62 (0-9a-zA-Z) or base64 (standard encoding).



This change would be backwards compatible.



------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53708&edit=1

Reply via email to