项目作者: matez0

项目描述 :
Calculating proof of work suffix with multiprocessing
高级语言: Python
项目地址: git://github.com/matez0/proof-of-work-multiprocessing.git
创建时间: 2021-07-20T22:34:35Z
项目社区:https://github.com/matez0/proof-of-work-multiprocessing

开源协议:MIT License

下载


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:

  1. make

Usage

  1. from pow_calculator import calculate_pow
  2. suffix = calculate_pow('input data', difficulty=5)

Acknowledgement

Exasol