Goals : Make a function to calculate certain part of a file where we skips certain bytes.
Problem : Testing on two identical files makes different results.
def checksum_contentonly(filename,sum_part, hash_factory=hashlib.md5, chunk_num_blocks=128): h = hash_factory() with open(filename,'rb') as f: for i in range(0,sum_part): if i==0: f.seek(240,0) else: f.seek(1240,1) chunk=f.read(1000) h.update(chunk) f.close() return h
I wonder if its possible to find out algorithm of some hash based on some input and output results.
for example ( this is only example not the real hash ) :
98754-123574 return 12
78644-231456 return 87
65779-123557 return 92
...and some more 100 results .
I am a fullstak web developer , so code is not a problem ... Thank You !
How do I conver the followint 32 bit HEX to 6 digit decimal?
I hashed certain field to get the above. However, I would need to generate 6 digit PIN.
While generating One Time Password, i used hmac-md5 algorithm(with respect to RFC 2104) and the hmac result is 128 bits. When hmac-SHA1 algorithm is used, the result will be 160 bits. I need to apply padding to my hmac-md5 result to make 20 byte. Which values should i use for padding?
I want to compute hash value of file, to check if the file content has changed.
I have Array-list holding lines of files as element of list. Now I want to compute the Hash value of it.
Is the Hash value best for it to check if the file is modified or not ?