We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e9f41f commit e96ebd2Copy full SHA for e96ebd2
glueops/checksum_tools.py
@@ -1,4 +1,5 @@
1
import zlib
2
+import hashlib
3
4
def string_to_crc32(input_string: str) -> str:
5
"""Compute CRC32 checksum for a given string and return it in hexadecimal format."""
@@ -10,3 +11,10 @@ def string_to_crc32(input_string: str) -> str:
10
11
12
# Convert checksum to hexadecimal
13
return hex(checksum)
14
+
15
+def compute_sha224(input_string: str) -> str:
16
+ """Compute SHA224 checksum for a given string and return it in hexadecimal format."""
17
18
+ sha224_hash = hashlib.sha224()
19
+ sha224_hash.update(input_string.encode('utf-8'))
20
+ return sha224_hash.hexdigest()
0 commit comments