import sys def hashMod(bytes): result = 0 for byte in bytes: result += byte return result % sys.maxsize if __name__ == "__main__": test_hashmod = hashMod("test".encode('utf-8')) print("Teste function hashMod : ", test_hashmod)