Dieses Repository enthält Python-Dateien die im Rahmen des Wahlpflichtmoduls "Informationssysteme in der Medizintechnik" (Dozent: Prof. Dr. Oliver Hofmann) erstellt wurden und verwaltet deren Versionskontrolle.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

hashes.py 441B

1234567891011121314
  1. import sys
  2. """ Modul zur Erzeugung eines Hashwerts für Strings, die als Bytefolgen interpretiert werden """
  3. def hashMod(bytes):
  4. result = 0
  5. for byte in bytes:
  6. result += byte
  7. return result % sys.maxsize
  8. if __name__ == "__main__":
  9. myByteArray = bytearray("Schokopraline", encoding='utf-8')
  10. hashvalue = hashMod(myByteArray)
  11. print("Ohne importierten Aufruf lautet der Hashwert zu 'Schokopraline': ", hashvalue)