<p>hashesPerSecond = math.pow(2, 32) * proofsOfWork / secondsElapsed</p>

<p>where proofsOfWork is the number of difficulty 1 proofs of work (aka shares) that the user or pool has found during secondsElapsed seconds.</p>

<p>If you use variable difficulty, then you can count a proof of work from someone mining at difficulty X the same as X proofs of work at difficulty 1.</p>

<p>For mhps divide by 1e6. For ghps divide by 1e9. And so on..</p>

<p>math.pow(2, 32) == 4294967296</p>

CC BY-SA 3.0
2012-11-10T08:39:15.683Z
2012-11-10T08:39:15.683Z
Dr.Haribo
<p>I need to display the pool and worker hashrates on my website.
The pool uses PSQL.</p>

<mining-pools><mining-pool-shares>
What is the correct algorithm to calculate worker & pool hashrate
Aurigae
# What is the correct algorithm to calculate worker & pool hashrate

(Asked by: username_0 on 2012-11-09)

I need to display the pool and worker hashrates on my website.
The pool uses PSQL.

**Tags:** mining-pools, mining-pool-shares


---

## 1 answers

### Answer by username_1 on 2012-11-10. Score: 3 | Accepted answer

hashesPerSecond = math.pow(2, 32) \* proofsOfWork / secondsElapsed

where proofsOfWork is the number of difficulty 1 proofs of work (aka shares) that the user or pool has found during secondsElapsed seconds.

If you use variable difficulty, then you can count a proof of work from someone mining at difficulty X the same as X proofs of work at difficulty 1.

For mhps divide by 1e6. For ghps divide by 1e9. And so on..

math.pow(2, 32) == 4294967296


---

