def HashFile(f):
 if (type(f) is list):
  f = f[0]
 try:
  return hashlib.sha256(open(f, 'rb').read()).hexdigest()
 except:
  return 'UNKNOWN'

def HashFile ( f ) : if ( type ( f ) is list ) : f = f [ 0 ] try : return hashlib . sha256 ( open ( f , 'rb' ) . read ( ) ) . hexdigest ( ) except : return 'UNKNOWN'
returns sha-256 hash of a given file .