Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 802 Bytes

README.md

File metadata and controls

36 lines (23 loc) · 802 Bytes

Calculating proof of work suffix with multiprocessing

Given an input data as an utf-8 string and a difficulty number, a suffix is a proof of work (PoW) of the input data, if the hex dump of the SHA1 hash of the concatenation of the input data and the suffix starts with difficulty number of zeros.

The search for PoW suffix is distributed among the CPU cores using the multiprocessing python module. For higher performance, the search process is implemented in C.

Build

Dependencies:

  • openssl-dev
  • python
  • pytest

Build the library for finding suffixes:

make

Usage

from pow_calculator import calculate_pow

suffix = calculate_pow('input data', difficulty=5)

Acknowledgement

Exasol