Giter VIP home page Giter VIP logo

pymerkletools's Introduction

Tierion

This repository hosts public information about Tierion.

Table of Contents

All approved links to Tierion assets.

Tierion's community guidelines which govern all Tierion communities.

Tierion's community rules which is a simplified version of the Community Guidelines

pymerkletools's People

Contributors

bascoe10 avatar edersantana avatar faustow avatar filips123 avatar grempe avatar jacohend avatar jasonbukowski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pymerkletools's Issues

Question: Merkle-Trees

Hello,
just came across your github while trying to implement a merkle-tree and hope you can help me get on the right track.

here is the tree how it SHOULD look like

                                                                       ROOT
                                                F                                                  F
                                   F                         F                       71                        F
                         13             80         54       38            99       27           65    87

i have no idea how the get the 71 from the 99 and the 27.
i need to calculate the root only from this nowing decimals. i believe the final thing is a SHA256 hash, but i'm not pretty sure.

so whats next, i'm trying to build an implemention (based on yours) with the following features:

  1. set the level of deep for the tree, for my example its 4 levels, with same number of leaves of each site (no uplifting)

  2. select the hashing (MD5, SHA1, SHA256, whatever)

  3. input the base data (for me its 13,80 for the first, 54,48 for the second, 99,27 for the third, 65,87 for the last.

  4. calculate the tree

if you have any snippets for that it would help me really.
thanks in advance

hheileeeee

Explicit Python >= 3.7 support

The PyPI project page for pymerkletools currently only lists explicit supports for Python <= 3.6. More importantly, TravisCI tests currently only test pymerkletools under Python 2.7 and 3.5. However, I can personally confirm that pymerkletools both installs and behaves as expected under at least Python 3.7. The same probably follows for Python 3.8 as well.

Thankfully, the fix appears trivial:

  • Explicitly list Python 3.6, 3.7, and 3.8 in .travis.yml to guarantee compatibility: e.g.,
python:
  - "2.7"
  - "3.5"
  - "3.6"
  - "3.7"
  - "3.8"
  • Explicitly list Python 3.5, 3.6, 3.7, and 3.8 in setup.py for PyPI readability: e.g.,
    classifiers=[
        "Intended Audience :: Developers",
        "Intended Audience :: Education",
        "Intended Audience :: Science/Research",
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Topic :: Software Development :: Libraries",
        "Topic :: Software Development :: Libraries :: Python Modules"
    ],

Thanks for all Merkle, @Tierion! You rock the Bitcoin Casbah. ๐Ÿฅ‡

Can't import merkletools library

I have successfully executed merkletools operations in normal python scripts. But when working on CGI scripts, I cant import merkletools library using from merkletools import MerkleTools . Is there any solution for this ?

"tests" package erroneously installed by "setup.py"

Greetings and cryptographic salutations. I'm currently packaging merkletools for Gentoo and briefly faceplanted into a minor installation-time issue.

wat is bad?

Specifically, the top-level setup.py script erroneously installs the tests package. This is bad โ€“ not simply under Gentoo but under any Python environment. Why? Coupla reasons:

  • Ambiguity. If every Python project attempted to install an ambiguously named tests package, no Python project would be installable. Since these packages would conflict with one another at installation time, no sane packager (e.g., pip, easy_install) would permit these projects to be concurrently installed.
  • Irrelevance. By convention, test packages are typically not installed; they're simply bundled with source tarballs for external usage by interested third parties. If you really, really do want the tests package to be installed, it should probably be moved under the top-level merkletools package (e.g., as a new merkletools.tests subpackage).

how to make good?

We've trivially patched this on our end. Here's how you can, too. In setup.py:

    # Replace this bad line...
    packages=find_packages(),

    # ...with this good line.
    packages=find_packages(exclude=["tests"]),

That's it. Easy peasy. Thanks for all the fruitful Merkle trees, all! ๐ŸŒณ

Traceback Error

This may be a stupid question. Need some help though
I have written simple code using "merkletools" as below

import merkletools
mt = MerkleTools(hash_type="sha256") 
for i in range (6):
    hex_data = raw_input("Enter the hash")
    mt.add_leaf(hex_data)
leaf_count =  mt.get_leaf_count()

I have installed the merkletools library using
pip install merkletools
but still, I am getting an error

Traceback (most recent call last):
File "merkle_test.py", line 3, in
mt = MerkleTools(hash_type="sha256")
NameError: name 'MerkleTools' is not defined

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.