refactor: Replace string reading methods with CString equivalents and improve error handling

This commit is contained in:
Winston Lowe
2026-03-22 10:50:11 -07:00
parent dbefb0b5f4
commit 767dc1164e
8 changed files with 82 additions and 135 deletions
+1 -11
View File
@@ -169,16 +169,6 @@ void main() {
expect(first, equals(second));
});
test('hash is exactly 4 bytes long', () {
final hash = MessageRetryService.computeExpectedAckHash(
fixedTs,
0,
fixedText,
fixedKey,
);
expect(hash.length, equals(4));
});
test('hash matches manual SHA-256 computation', () {
for (int attempt = 0; attempt < 4; attempt++) {
final actual = MessageRetryService.computeExpectedAckHash(
@@ -509,7 +499,7 @@ void main() {
fixedText,
fixedKey,
);
final hex = hash.map((b) => b.toRadixString(16).padLeft(2, '0')).join();
final hex = hash.toRadixString(16).padLeft(8, '0');
expect(
hashes.containsKey(hex),
isFalse,