added option to specify base

This commit is contained in:
Kjistóf 2017-12-01 20:45:52 +01:00
parent 44be18044d
commit 7ea8082fd2
1 changed files with 2 additions and 2 deletions

View File

@ -4,8 +4,8 @@ from hashlib import sha256
class proofow:
def __init__(self, difficulty):
self._base = urandom(32)
def __init__(self, difficulty, base=None):
self._base = urandom(32) if not base else base
self._target = 2 ** (256 - difficulty)
def work(self):