note 51007 deleted from function.base-convert by danbrown
| From: | danbrown@php.net | Date: | Sat, 02 Jul 2011 15:40:43 +0000 |
| Subject: | note 51007 deleted from function.base-convert by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-181172@lists.php.net to get a copy of this message | ||
Note Submitter: tomhiggy at gmail dot com
----
I was looking for a function to convert the base encoding of a sha1 hash from base 16 to a custom
base 32 (using characters [A-Z2-7], as used by several filesharing applications).
The function custombase_convert() posted by Fips isn't able to cope with numbers above a
certain value. It returns the first few (around 10) characters correctly but each character after is
a 0 value ('A' in this case).
I've solved the problem for now by requesting in groups of 10 base 16 characters and appending
the result to the final base 32 value. If anyone has any better solutions, please let me know.