Skip to content

Commit 3d374a8

Browse files
feat: adding compute_sha224
1 parent 4e9f41f commit 3d374a8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

glueops/checksum_tools.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import zlib
2+
import hashlib
23

34
def string_to_crc32(input_string: str) -> str:
45
"""Compute CRC32 checksum for a given string and return it in hexadecimal format."""
@@ -10,3 +11,8 @@ def string_to_crc32(input_string: str) -> str:
1011

1112
# Convert checksum to hexadecimal
1213
return hex(checksum)
14+
15+
def compute_sha224(text):
16+
sha224_hash = hashlib.sha224()
17+
sha224_hash.update(text.encode('utf-8'))
18+
return sha224_hash.hexdigest()

0 commit comments

Comments
 (0)