View Single Post
Old 07-08-2005, 07:16 PM   #246
Tommy
Nameless Being
 
The official code ;)

Now that Google didn't bother to release a version of its toolbar for Firefox, you can actually parse the official code which looks surprisingly similar to the one reverse-engineered in this forum Only look how the seed is now calculated... looks like someone was referring to us here, heheheheee:

from pagerank.js:

Code:
var GPR_HASH_SEED = "Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer.";

var hash = "8" + GPR_awesomeHash(page);

function GPR_awesomeHash(value) {
  var kindOfThingAnIdiotWouldHaveOnHisLuggage = 16909125;
  for(var i = 0;i < value.length;i ++ ) {
    kindOfThingAnIdiotWouldHaveOnHisLuggage ^= GPR_HASH_SEED.charCodeAt(i % GPR_HASH_SEED.length) ^ value.charCodeAt(i);
    kindOfThingAnIdiotWouldHaveOnHisLuggage = kindOfThingAnIdiotWouldHaveOnHisLuggage >>> 23 | kindOfThingAnIdiotWouldHaveOnHisLuggage << 9}
  return GPR_hexEncodeU32(kindOfThingAnIdiotWouldHaveOnHisLuggage)}

function GPR_hexEncodeU32(num) {
  var result = GPR_toHex8(num >>> 24);
  result += GPR_toHex8(num >>> 16 & 255);
  result += GPR_toHex8(num >>> 8 & 255);
  return result + GPR_toHex8(num & 255)}

function GPR_toHex8(num) {
  return(num < 16 ? "0" : "") + num.toString(16)}
  Reply With Quote