def HashGen(APP_PATH):
 try:
  print '[INFO] Generating Hashes'
  sha1 = hashlib.sha1()
  sha256 = hashlib.sha256()
  BLOCKSIZE = 65536
  with io.open(APP_PATH, mode='rb') as afile:
   buf = afile.read(BLOCKSIZE)
   while buf:
    sha1.update(buf)
    sha256.update(buf)
    buf = afile.read(BLOCKSIZE)
  sha1val = sha1.hexdigest()
  sha256val = sha256.hexdigest()
  return (sha1val, sha256val)
 except:
  PrintException('[ERROR] Generating Hashes')

def HashGen ( APP_PATH ) : try : print '[INFO] Generating Hashes' sha1 = hashlib . sha1 ( ) sha256 = hashlib . sha256 ( ) BLOCKSIZE = 65536 with io . open ( APP_PATH , mode = 'rb' ) as afile : buf = afile . read ( BLOCKSIZE ) while buf : sha1 . update ( buf ) sha256 . update ( buf ) buf = afile . read ( BLOCKSIZE ) sha1val = sha1 . hexdigest ( ) sha256val = sha256 . hexdigest ( ) return ( sha1val , sha256val ) except : PrintException ( '[ERROR] Generating Hashes' )
generate and return sha1 and sha256 as a tupel .