Skip to Content
oxcrypto

SHA-3

SHA-3 digest algorithms.

Example

from oxcrypto.hash.sha3 import SHA3

algorithm = SHA3.SHA3_256
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

  • SHA3.SHA3_224
  • SHA3.SHA3_256
  • SHA3.SHA3_384
  • SHA3.SHA3_512

Methods

digest(self, data: bytes, /) -> bytes
digest_chunks(self, chunks: Iterable[bytes], /) -> bytes
new(self) -> Hasher

On this page