Is there a website or service that computes how much a megahash/s will earn you daily on average, taking into account the current difficulty?

Thanks!

If you know how to use R:

coins.currentdiff<-function(days,hashrate)

{

block.val<-50

current.difficulty<-scan(url("http://blockexplorer.com/q/getdifficulty"))

(block.val*10^6*days*24*3600*hashrate)/((current.difficulty)*2^32)

}

if not, amount of coins from a given rate of Mhps:

block value * 10^6 * hashrate (mhps) /(current difficulty*2^32)

In the case of 1 Mhps and 1 second (ie 1 Mhash), and current difficulty and block value:

52 * 10^6 * 1/(434882.7*2^32) = 2.676936e-08 coins.

This will of course change as difficulty and block value change, and keep in mind these are average expected values. Also there is a history of difficulty somewhere, but i can't find linky.

Hope this helps.