Hi Guys,
I am new to this forum and was excited to see that people are really working together to find the PHP version of the google checksum algo.
I would also be part of this joint effort and would also love to see the working PHP version.
By far and large I know about the checksum calculation is that it is using Hash Function and instead of using the lengthy process if we could translate the Hash Function by Bob Jenkins at :
http://burtleburtle.net/bob/c/lookup2.c to PHP it would really work good for us.
The Process:
GOOGLE_MAGIC = 0xe6359a60
The functions that would be required are: mix(a,b,c) and ub4 hash( k, length, initval)
would be called as: hash(url, strlen(url), GOOGLE_MAGIC));
We need to encode the url first.
The C version of the urlencode function is as follows:
void urlencode(char *u, char *e) {
while (*u != '\0') {
if (*u == '.') {
*e++ = '%';
*e++ = '2';
*e = 'E';
} else if (*u == ':') {
*e++ = '%';
*e++ = '3';
*e = 'A';
} else if (*u == '/') {
*e++ = '%';
*e++ = '2';
*e = 'F';
} else {
*e = *u;
}
u++;
e++;
}
}
I am already working on a C version of the same. And I hope it would be complete soon.
I hope this will help.
Cheers,
CyberaX