in reply to SHA1 Not Generating Properly
What is mid.decode in s = hashlib.sha1(mid.decode('hex'))?
What you got in $var is a STRING not a hex number
Use $var = pack 'H*', $var ;