Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add entrypoint #47

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

willianpaixao
Copy link

I was looking for the easiest and fastest way to hash a string. I also understand this is a library so maybe this PR should instead go to eth-utils. Let me know what you think.

The PR intention is to be able to quickly hash something without having to opening a interactive Python console. Using console scripts and in this case I had to add a main function to cast the incoming string.

Note: this PR only hashes the first given argument, in case you need to send multiple strings, I would need to update the function.

How to test

$ pip install -e .[dev]
$ eth-hash "Hello World"
b'Y/\xa7C\x88\x9f\xc7\xf9*\xc2\xa3{\xb1\xf5\xba\x1d\xaf*\\\x84t\x1c\xa0\xe0\x06\x1d$:.g\x07\xba'

I could go further and make it more complicated, adding type checks, encoding options, a CLI library, etc. But need to know if this feature is desired in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant