Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > Miscellaneous > Lounge

Notices

Reply
 
Thread Tools Search this Thread
Old 06-26-2004, 10:46 AM   #31
alexstapleton
Enthusiast
alexstapleton doesn't litteralexstapleton doesn't litter
 
Posts: 49
Karma: 123
Join Date: Jun 2004
I think part of the problem is PHPs total lack of support for unsigned data types. Whilst I could write a bunch of UINT arithmatic functions, I don't think that is an elegant solution. So if you give me a while, I may write a PHP extension using the ASM code.
alexstapleton is offline   Reply With Quote
Old 06-26-2004, 10:55 AM   #32
doctorow
Guru
doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.
 
doctorow's Avatar
 
Posts: 897
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
Yes and no. I have been working on the script for the past hour and also noticed that the problem is PHP automatic type cast conversion. While UINT is not supported, forcing all the operations to (int) should do the trick as well. Lemme finish the editing and see what the result will be. Another small fix:

if($url_length > 12) {

should be

if($url_length >= 12) {
doctorow is offline   Reply With Quote
Old 06-26-2004, 10:59 AM   #33
doctorow
Guru
doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.
 
doctorow's Avatar
 
Posts: 897
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
Another small fix:
when you load the string chars to the $variables, we must convert the ascii value first using ord(), e.g.

$eax = ord($ecx{7+$ebp});// ;load 8th
$edx = ord($ecx{6+$ebp});// ;load 7th
doctorow is offline   Reply With Quote
Old 06-26-2004, 11:04 AM   #34
UnknownZ
Junior Member
UnknownZ began at the beginning.
 
Posts: 6
Karma: 22
Join Date: Jun 2004
I hope I can get the PHP script too. I have been looking at google.com for these past 4 weeks and all of them require money in order to get the script. I found this thread actually from google.com. Please share it if it is done. Many many thanks in advance.
UnknownZ is offline   Reply With Quote
Old 06-26-2004, 11:28 AM   #35
doctorow
Guru
doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.
 
doctorow's Avatar
 
Posts: 897
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
Ok while normal operations work ok even with signed integers, bit shifting operations (>>) can really mess up when the integer is negative. Hmm. Stinks Will think of something.
doctorow is offline   Reply With Quote
Old 06-26-2004, 01:01 PM   #36
alexstapleton
Enthusiast
alexstapleton doesn't litteralexstapleton doesn't litter
 
Posts: 49
Karma: 123
Join Date: Jun 2004
I already did ord() conversion on the entire url. Theres a for loop that does it around line 40. PHP also has a tendency to convert the large values to floats. Which it shouldnt as the algorithm relies to some extent on overflow it seems. And er. It is >= on my script. Are you looking at googlehash.php? That has the full source of googlehash-test.php up to date in it.
alexstapleton is offline   Reply With Quote
Old 06-26-2004, 01:01 PM   #37
alexstapleton
Enthusiast
alexstapleton doesn't litteralexstapleton doesn't litter
 
Posts: 49
Karma: 123
Join Date: Jun 2004
http://meese.ath.cx/google/googlehash.php
alexstapleton is offline   Reply With Quote
Old 06-26-2004, 01:05 PM   #38
doctorow
Guru
doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.
 
doctorow's Avatar
 
Posts: 897
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
ok... btw I think you should use e.g.

$eax = (int)($eax+$edx);

instead of

$eax = (int)$eax+$edx;

otherwise the typecast only applies to the right operator of the operation and the result could still be a long.
doctorow is offline   Reply With Quote
Old 06-26-2004, 01:06 PM   #39
doctorow
Guru
doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.
 
doctorow's Avatar
 
Posts: 897
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
btw, i downloaded the update now and will look at it again.
doctorow is offline   Reply With Quote
Old 06-26-2004, 01:47 PM   #40
doctorow
Guru
doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.
 
doctorow's Avatar
 
Posts: 897
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
signed/unsigned in general is not a problem, except for the rightshift operator >> ... a right shift fills the left bits with whatever the original sign bit (leftmost bit) held... so if the number was negative, the bits will be all filled with 1's, but they should be filled with zeros instead (unsigned right shift).
doctorow is offline   Reply With Quote
Old 06-26-2004, 01:57 PM   #41
doctorow
Guru
doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.
 
doctorow's Avatar
 
Posts: 897
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
I found the needed snipped from a SHA1 implementation for PHP:

Use

$eax = (int)(zerofill($eax, 0x0c));

instead of

$eax = (int)(eax >> 0x0c);

and define the following function:

PHP Code:
function zeroFill($a$b)
{
    
$z hexdec(80000000);
        if (
$z $a)
        {
            
$a >>= 1;
            
$a &= (~$z);
            
$a |= 0x40000000;
            
$a >>= ($b-1);
        }
        else
        {
            
$a >>= $b;
        }
        return 
$a;

doctorow is offline   Reply With Quote
Old 06-26-2004, 02:03 PM   #42
alexstapleton
Enthusiast
alexstapleton doesn't litteralexstapleton doesn't litter
 
Posts: 49
Karma: 123
Join Date: Jun 2004
Updated with what you said. I've been running the Komodo debugger on it to check for floats and things, and I havent seen anything turn into a float with just (int) yet, but ill add the extra brackets anyway.
alexstapleton is offline   Reply With Quote
Old 06-26-2004, 02:08 PM   #43
doctorow
Guru
doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.
 
doctorow's Avatar
 
Posts: 897
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
Ok, it's working

I will clean up the code a bit and then contact you, Alex!
doctorow is offline   Reply With Quote
Old 06-26-2004, 02:12 PM   #44
alexstapleton
Enthusiast
alexstapleton doesn't litteralexstapleton doesn't litter
 
Posts: 49
Karma: 123
Join Date: Jun 2004
And why arent you on AIM?:P
alexstapleton is offline   Reply With Quote
Old 06-26-2004, 02:13 PM   #45
doctorow
Guru
doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.doctorow ought to be getting tired of karma fortunes by now.
 
doctorow's Avatar
 
Posts: 897
Karma: 3410461
Join Date: May 2004
Device: Kindle Touch
heh same reason like yesterday... my "better half"....
doctorow is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Seriously thoughtful Dekker's Algorithm help. Catire Lounge 13 03-19-2010 11:03 AM
Bulk Pagerank Checker Script? SNaRe Lounge 2 10-22-2006 05:36 PM
Google Toolbar Pagerank Checksum Revealed! Alexander Turcic Lounge 5 02-17-2006 09:09 AM
Google Checksum CH calculator cyberax Lounge 2 08-17-2004 10:37 PM


All times are GMT -4. The time now is 06:50 PM.


MobileRead.com is a privately owned, operated and funded community.