Hi.
Unfortunately, this is how base_convert() works.  The problem is that
base convert uses double or float internally and this limits the
precision of the numbers it can hold to 53 bits (about 13 hex digits)
in the case of double (or only 24 bits - 6 hex digits for float).
What's happening is your 160 bit sha1 digest is being truncated to the
first 53 bits -- after that the results are undefined, which i'm sure
is not what you intended.  Don't try to do any maths on the result of
hash() unless you first divide up the string into parts first -- if
you want to use base_convert() than those parts should be no longer
than 6 characters each.
-Craig

> I've been doing some work with a framework and have found a problem with
> base_convert.
--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to