Can a miner's hashrate be derived from shares submitted at a given difficulty? Trying to generate useful stats about client activity in a pool. If a quantity of submitted (timestamped) shares is known, and the difficulty of each share is known, how can the client's aggregate hashrate be determined?
hashes = shares * share_difficulty * 2**48 / 65535


thus:

megahash_per_second = shares_per_second * share_difficulty * 4295.032833