Commit b83ac44e authored by Alex March's avatar Alex March Committed by Paul Sokolovsky

tests/extmod/uhashlib_sha1: Coverage for SHA1 algorithm.

parent b0feef7a
import sys
try:
import uhashlib as hashlib
except ImportError:
try:
import hashlib
except ImportError:
# This is neither uPy, nor cPy, so must be uPy with
# uhashlib module disabled.
print("SKIP")
sys.exit()
try:
hashlib.sha1
except AttributeError:
# SHA1 is only available on some ports
print("SKIP")
sys.exit()
sha1 = hashlib.sha1(b'hello')
sha1.update(b'world')
print(sha1.digest())
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment