Skip to content

Commit 71c9f0d

Browse files
chore: improve keccak256 docstring and update changelog (hiero-ledger#1862)
Signed-off-by: Geesha <141132370+GeeshaN2001@users.noreply.github.com> Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com> Co-authored-by: exploreriii <133720349+exploreriii@users.noreply.github.com>
1 parent 9f64e9f commit 71c9f0d

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
2323
### Src
2424
- Fix `TopicInfo.__str__()` to format `expiration_time` in UTC so unit tests pass in non-UTC environments. (#1800)
2525
- Resolve CodeQL `reflected-XSS` warning in TCK JSON-RPC endpoint
26+
- Improve `keccak256` docstring formatting for better readability and consistency (#1624)
2627

2728
### Examples
2829
- Refactor `examples/file/file_create_transaction.py` to remove `os`,`dotenv`,`AccountId`,`PrivateKey`,`Network` imports that are no longer needed and updated setup-client() (#1610)

src/hiero_sdk_python/utils/crypto_utils.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,20 @@
1717

1818
def keccak256(data: bytes) -> bytes:
1919
"""
20-
Mirroring the Java code's `Crypto.calcKeccak256`.
20+
Compute the Keccak-256 hash of the input data.
21+
22+
This mirrors the Java SDK's `Crypto.calcKeccak256` function.
23+
24+
Args:
25+
data: The bytes to hash.
26+
27+
Returns:
28+
bytes: The 32-byte Keccak-256 hash digest.
29+
30+
Raises:
31+
RuntimeError: If pycryptodome or similar keccak library is not installed.
2132
"""
33+
2234
global keccak
2335
if keccak is None:
2436
raise RuntimeError("Keccak not available. Install pycryptodome or similar.")

0 commit comments

Comments
 (0)