Python: Expand stdlib md5 tests with keyword-arguments

This commit is contained in:
Rasmus Wriedt Larsen
2021-03-02 16:45:09 +01:00
parent fa88f22453
commit 7ffbfa8043

View File

@@ -5,6 +5,10 @@ hasher = hashlib.md5(b"secret message") # $ MISSING: CryptographicOperation Cryp
print(hasher.hexdigest())
hasher = hashlib.md5(string=b"secret message") # $ MISSING: CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=MD5
print(hasher.hexdigest())
hasher = hashlib.md5()
hasher.update(b"secret") # $ MISSING: CryptographicOperation CryptographicOperationInput=b"secret" CryptographicOperationAlgorithm=MD5
hasher.update(b" message") # $ MISSING: CryptographicOperation CryptographicOperationInput=b" message" CryptographicOperationAlgorithm=MD5
@@ -15,6 +19,10 @@ hasher = hashlib.new('md5', b"secret message") # $ MISSING: CryptographicOperati
print(hasher.hexdigest())
hasher = hashlib.new('md5', data=b"secret message") # $ MISSING: CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=MD5
print(hasher.hexdigest())
hasher = hashlib.new('md5')
hasher.update(b"secret") # $ MISSING: CryptographicOperation CryptographicOperationInput=b"secret" CryptographicOperationAlgorithm=MD5
hasher.update(b" message") # $ MISSING: CryptographicOperation CryptographicOperationInput=b" message" CryptographicOperationAlgorithm=MD5