mirror of
https://github.com/github/codeql.git
synced 2025-12-19 18:33:16 +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).
30 lines
1.3 KiB
Python
30 lines
1.3 KiB
Python
import hashlib
|
|
|
|
|
|
hasher = hashlib.md5(b"secret message") # $ CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=MD5
|
|
print(hasher.hexdigest())
|
|
|
|
|
|
hasher = hashlib.md5(string=b"secret message") # $ CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=MD5
|
|
print(hasher.hexdigest())
|
|
|
|
|
|
hasher = hashlib.md5()
|
|
hasher.update(b"secret") # $ CryptographicOperation CryptographicOperationInput=b"secret" CryptographicOperationAlgorithm=MD5
|
|
hasher.update(b" message") # $ CryptographicOperation CryptographicOperationInput=b" message" CryptographicOperationAlgorithm=MD5
|
|
print(hasher.hexdigest())
|
|
|
|
|
|
hasher = hashlib.new('md5', b"secret message") # $ CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=MD5
|
|
print(hasher.hexdigest())
|
|
|
|
|
|
hasher = hashlib.new('md5', data=b"secret message") # $ CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=MD5
|
|
print(hasher.hexdigest())
|
|
|
|
|
|
hasher = hashlib.new('md5')
|
|
hasher.update(b"secret") # $ CryptographicOperation CryptographicOperationInput=b"secret" CryptographicOperationAlgorithm=MD5
|
|
hasher.update(b" message") # $ CryptographicOperation CryptographicOperationInput=b" message" CryptographicOperationAlgorithm=MD5
|
|
print(hasher.hexdigest())
|