Skip to content

Conversation

@malkovitc
Copy link

Summary

Fixes #646

Harden hex string parsing to prevent crashes from malformed input.

Test plan

  • Test with valid hex strings
  • Test with invalid/malformed hex strings
  • Verify no crashes on edge cases

🤖 Generated with Claude Code

evgeniy.chernomortsev added 2 commits December 9, 2025 14:50
allowBluetoothHFP is not available on iOS Simulator, causing build
failures. Use conditional compilation to exclude this option when
building for simulator while keeping it for device builds.
Improve Data(hexString:) to handle edge cases:
- Reject odd-length strings (return nil)
- Support optional 0x/0X prefix
- Trim leading/trailing whitespace
- Handle empty strings correctly

Add comprehensive unit tests for hex parsing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improvement: Harden and reuse hex parsing across the codebase

1 participant