Coder Social home page Coder Social logo

libproofofwork's Introduction

libProofOfWork

Travis PyPI PyPI PyPI PyPI

Simple hash-mining c library and its python binding.

Requirements

  • cmake and things to build
  • non-old CPU for AVX2 instructions
    • Check flags sections of your /proc/cpuinfo.
  • OpenMP (optional)

How to Install

$ pip install proofofwork

How to Use

>>> import proofofwork
>>> import hashlib

>>> s = proofofwork.md5('00000000')
>>> s
b'erno8AAA'
>>> hashlib.md5(s).hexdigest()
'0000000057c4ca67d38e6826053824bd'

>>> s = proofofwork.sha1('000??????????????????????????????????000', text=b'sha1{????????}', alphabet=bytes(range(128, 256)))
>>> s
b'sha1{\xcb\xf0\xa4\x80\x80\x80\x80\xe0}'
>>> hashlib.sha1(s).hexdigest()
'00099d6917591c54f861032fd0d0071fbc647000'

Benchmark

MD5

In my laptop environment (Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz),

Code Speed [hashes/sec]
libproofofwork 158000000
C openssl 5890000
python hashlib 794000

SHA1

In my laptop environment (Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz),

Code Speed [hases/sec]
libproofofwork 83700000
C openssl 6360000
python hashlib 815000

License

MIT License

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.