<s> from os import path <EOL> import hashlib <EOL> def sha1 ( filepath ) : <EOL> """<STR_LIT>""" <EOL> filepath = path . normpath ( filepath ) <EOL> if not path . isfile ( filepath ) : <EOL> return "<STR_LIT>" <EOL> with open ( filepath , "<STR_LIT:rb>" ) as fh : <EOL> data = fh . read ( ) <EOL> hash = hashlib . sha1 ( ) <EOL> hash . update ( data ) <EOL> return hash . hexdigest ( ) </s>
