From a74603594a14f3ad0484ca9a5f00458404692c75 Mon Sep 17 00:00:00 2001 From: Rodrigo Tobar Date: Sun, 11 Aug 2024 21:35:41 +0800 Subject: [PATCH] Show show to compare digest() to crc32c() Signed-off-by: Rodrigo Tobar --- README.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.rst b/README.rst index 2428ee2..2fd941e 100644 --- a/README.rst +++ b/README.rst @@ -68,6 +68,9 @@ of the standard library: crc32c_hash.update(b' world') print(crc32c_hash.digest()) # b'\xc9\x94e\xaa' + digest_as_int = int.from_bytes(crc32c_hash.digest(), "big") + print(digest_as_int == crc32c.crc32c(b'hello world')) + # True For more details see the documentation on `hash objects `_.