Bug #3551: base_convert()
| From: | rs at aelea dot com | Date: | Mon, 21 Feb 2000 16:57:37 +0000 |
| Subject: | Bug #3551: base_convert() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-15758@lists.php.net to get a copy of this message | ||
From: rs@aelea.com
Operating system: Linux 2.2.14
PHP version: 3.0.14
PHP Bug Type: Misbehaving function
Bug description: base_convert()
base_convert() does not accept values larger than 31 bits (e.g. 7 hex chars = 28bits is OK, 8 hex
chars at 32 bits is not)
Appears in the code that the string is converted to a signed long.
a) should at least report an error if value > 31 bits.
b) Would be helpful to operate on larger values, e.g. md5 hashes, which are 128 bits or even on
double hashes at 256 bits.
c) would be easy to increase bases to 64 from 36 by making
static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
in ext/standard/math.c (_php_math_longtobase())) which would work for most things (e.g. URLs &
GET method) as well as filenames.