mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
This PR was rebased on newest main, but was written a long time ago when all the framework test-files were still in experimental. I have not re-written my local git-history, since there are MANY updates to those files (and I dare not risk it).
11 lines
326 B
Python
11 lines
326 B
Python
from cryptography.hazmat.primitives import hashes
|
|
|
|
from binascii import hexlify
|
|
|
|
|
|
hasher = hashes.Hash(hashes.MD5())
|
|
hasher.update(b"secret message") # $ CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=MD5
|
|
|
|
digest = hasher.finalize()
|
|
print(hexlify(digest).decode('utf-8'))
|