note 51007 added to function.base-convert
| From: | tomhiggyatgmaildotcom at osu1 dot php dot net | Date: | Wed, 16 Mar 2005 11:28:53 +0000 |
| Subject: | note 51007 added to function.base-convert | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86546@lists.php.net to get a copy of this message | ||
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.
----
Manual Page -- http://www.php.net/manual/en/function.base-convert.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51007
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51007&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51007&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51007&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51007&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51007&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51007&report=yes
Search -- http://master.php.net/manage/user-notes.php