February 7th, 2013, 11:31 PM
*newbie* SHA1 hash computation
I'm completely new to Python and can't wrap my head around this... I'm currently taking a class on this in post-grad school.
Okay, so here's what I need to do.
"Write a Python program that computes SHA1 hashes of a file, but truncates the digest to 8 bits (i.e., throw out all the digest, but the last 8 bits). Use your program to compute the 8-bit SHA1 hash of FILENAME.txt..."
I'm totally lost and would appreciate any guidance...
Thanks in advance.
February 8th, 2013, 12:24 PM
Mask the hash you compute with 255.
MYHASH & 0xff
[/code] are essential for python code and Makefiles!