1try: 2 import uhashlib as hashlib 3except ImportError: 4 try: 5 import hashlib 6 except ImportError: 7 # This is neither uPy, nor cPy, so must be uPy with 8 # uhashlib module disabled. 9 print("SKIP") 10 raise SystemExit 11 12try: 13 hashlib.md5 14except AttributeError: 15 # MD5 is only available on some ports 16 print("SKIP") 17 raise SystemExit 18 19md5 = hashlib.md5(b"hello") 20md5.update(b"world") 21print(md5.digest()) 22