-
Notifications
You must be signed in to change notification settings - Fork 4
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
New get_hash() Function #1
Conversation
Also تَقَبَّلَ اللهُ مِنَّا وَمِنكُم |
An example of usage is this:
|
Is the hashlib library installed using pip? |
Hashlib has been part of the standard library since python2. 5, released in 2006. You don't need to install it from pypi. |
Also before I merge could you move the import hashlib in test.py into the setUp method. Thanks for this PR! |
I have? |
Also your welcome |
There is an empty method in the class called setUp() if you could remove the comment and replace that with the import that would be great |
Oh sorry. Will do when I’m free |
Sure, I will do later |
Alright awesome, will merge when the change is done. Thanks again :) |
I have been honoured to contribute to a open-source to a Python library. I will ensure the change is done. Thanks and your welcome. |
Will you do the change or would you like me to do it? I can commit them to this fork. |
No, but thanks any way. I was experiencing some problems when trying to do the change, so I just changed the test_get_hash(). This PR is ready for merging unless you have anything else to say. |
Oh, the tests were fine, please do use assertEqual. If you would like, I can rewrite the tests for you - try not to use print in tests. Before I merge, could you confirm whether you would want me to do that, or would you like to fix them yourself? |
Thanks - that will be helpful. I'm a little busy so appreciate it. |
Alright cool - thanks for the PR! Also, could you open discussions on this repository with any questions you have? |
If I do - I'll see if I can.
You are very welcome. |
Also @MKM12345, your |
Thanks @hamdivazim for this. |
What's in this usefulib?
The get_hash() function is used to calculate the SHA-256 hash of a given string. It takes a string as an argument, puts it in UTF-8 format, and then uses the hashlib library in Python to compute the SHA-256 hash of the encoded string. Finally, it returns the hexadecimal representation of the hash.
Did you add tests?
I was able to put my function in test.py.
Does this solve an issue?
No, just adds a new function
Checklist