Hashlib is a Python module that implements a common interface to many different secure hash and message digest algorithms.
Questions tagged [hashlib]
427 questions
-2
votes
2 answers
Function object is not iterable
Generating an MD5 checksum of a file
I have used one of the examples from the above link but made some a small change to it by removing the call to the function (originally from above):
import hashlib
hash = hashlib.md5()
with…

Keith Proctor
- 7
- 1
- 1
-3
votes
1 answer
Print () result is not output, can't find error
This script generates a hash, but somewhere it did not correctly write something in the function.
from bitcoin import *
import os
import hashlib
import base58
while True:
priv = random_key()
pubkey = privtopub(priv)
compress_pubkey =…

Izi Tors
- 3
- 3
-3
votes
1 answer
Different SHA1 but same SHA256
I am iterating through a folder containing binary files and am trying to compute for each file's hash values, specifically sha1 and sha256. On my runs, I weirdly get the same sha256 values for all files, but the sha1 values are different (thus…

jowabels
- 122
- 1
- 9
-3
votes
1 answer
How to add into my C project
I'm trying to run this code on Eclipse. But there is an error about the header mhash.h
"Error: No such a file or directory"
The code is this:
#include
#include
#include
int main(void)
{
int i;
MHASH td;
…

zankal
- 1
- 1
-4
votes
1 answer
Need Equivalent of SHA1 function in python
Please help me convert below JS code to Python.
const di_digest = CryptoJS.SHA1(di_plainTextDigest).toString(CryptoJS.enc.Base64);
di_plainTextDigest is a String.
I tried a few Python methods, but not working. Example
result =…

P Kishan
- 3
- 3
-9
votes
1 answer
Converting Java to Python
I was wondering if you guys could help me convert some java code to python. Basically I'm trying to get the same hash output that the java code executes. Currently all I have gotten to (in python) is using the hashlib module converting some string…

xev
- 1
- 1
- 6