HashesLegacy compatibility
SHA-1
SHA-1 digest algorithms.
SHA-1 is cryptographically broken. Available for legacy compatibility.
Example
from oxcrypto.hash.sha1 import SHA1
algorithm = SHA1.SHA1
digest = algorithm.digest(b"hello")
assert digest == algorithm.digest_chunks([b"he", b"llo"])
hasher = algorithm.new()
hasher.update(b"he")
hasher.update(b"llo")
assert hasher.digest() == digest
print(digest.hex())Variants
SHA1.SHA1
Methods
digest(self, data: bytes, /) -> bytes
digest_chunks(self, chunks: Iterable[bytes], /) -> bytes
new(self) -> Hasher