Difference between revisions of "User talk:Newacct"

From Geohashing
imported>Crox
imported>Newacct
Line 9: Line 9:
 
   $dec = hexdec($md5) / pow(16,15);
 
   $dec = hexdec($md5) / pow(16,15);
 
--[[User:Crox|Crox]] 20:17, 11 August 2010 (UTC)
 
--[[User:Crox|Crox]] 20:17, 11 August 2010 (UTC)
 +
 +
:But dividing by 16^15, doesn't that just basically drop the last 15 hex digits? --[[User:Newacct|Newacct]] 04:51, 12 August 2010 (UTC)

Revision as of 04:51, 12 August 2010

Hi Newacct,

I noticed your change on MediaWiki Implementation. I came to the conclusion that you probably wanted to write

    $dec = hexdec($md5);

as the $md5 variable is being re-used and replaced by the selected half. Using substr again would result in an empty string. I'm not familiar with the implementation, and wouldn't want to understand that guesscode anyway, so I'll leave it to you to figure out if I am correct. -- relet 13:22, 11 August 2010 (UTC)


hexdec will give you an integer, you would still need to divide it to get the correct result, so imho it should be
 $dec = hexdec($md5) / pow(16,15);

--Crox 20:17, 11 August 2010 (UTC)

But dividing by 16^15, doesn't that just basically drop the last 15 hex digits? --Newacct 04:51, 12 August 2010 (UTC)