Skip to content

Use stdlib toHexString#1242

Open
twyatt wants to merge 4 commits into
mainfrom
twyatt/hex
Open

Use stdlib toHexString#1242
twyatt wants to merge 4 commits into
mainfrom
twyatt/hex

Conversation

@twyatt

@twyatt twyatt commented Jul 22, 2026

Copy link
Copy Markdown
Member

Note

ManufacturerData and ServiceData toString outputs will now have lowercase hex (previously was uppercase).
This is more aligned with the default toHexString format provided by the stdlib, but should be called out in the release notes when this ships.

Note

Low Risk
Display/logging-only refactor with no BLE filtering or I/O behavior changes; minor toString() formatting differences possible where default hex casing differs from the old helper.

Overview
Replaces the internal Tuulbox-style ByteArray.toHexString helper with Kotlin stdlib toHexString / HexFormat.

Logging hex output (logs/Hex.kt) now builds a HexFormat from existing HexBuilder options (byte separator and upper vs lower case) and passes it to data.toHexString(format).

Filter debug strings for ManufacturerData use HexFormat.UpperCase for data so those fields stay uppercase in toString(); dataMask uses the default format.

Reviewed by Cursor Bugbot for commit 6bfa4b5. Configure here.

@twyatt twyatt added skip-changelog Excludes issue/PR from generated release change log. patch Changes that should bump the PATCH version number labels Jul 22, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 6bfa4b5. Configure here.

Comment thread kable-core/src/commonMain/kotlin/Filter.kt Outdated
@twyatt

twyatt commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

Ran HexTests against main @ 0a7f5f9:

Results
..

HexTests > customSeparator_singleByte_hasNoSeparator STARTED

HexTests > customSeparator_singleByte_hasNoSeparator PASSED

HexTests > customSeparator_multipleBytes_usesConfiguredSeparator STARTED

HexTests > customSeparator_multipleBytes_usesConfiguredSeparator PASSED

HexTests > defaultHex_multipleBytes_defaultsToSpaceSeparatorAndUpperCase STARTED

HexTests > defaultHex_multipleBytes_defaultsToSpaceSeparatorAndUpperCase PASSED

HexTests > defaultHex_singleByte_returnsUpperCaseHex STARTED

HexTests > defaultHex_singleByte_returnsUpperCaseHex PASSED

HexTests > lowerCase_multipleBytes_returnsLowerCaseHex STARTED

HexTests > lowerCase_multipleBytes_returnsLowerCaseHex PASSED

HexTests > customSeparatorAndLowerCase_combined STARTED

HexTests > customSeparatorAndLowerCase_combined PASSED

HexTests > emptySeparator_multipleBytes_producesContiguousHex STARTED

HexTests > emptySeparator_multipleBytes_producesContiguousHex PASSED

HexTests > defaultHex_emptyData_returnsEmptyString STARTED

HexTests > defaultHex_emptyData_returnsEmptyString PASSED

@twyatt twyatt removed the skip-changelog Excludes issue/PR from generated release change log. label Jul 23, 2026
@twyatt
twyatt marked this pull request as ready for review July 23, 2026 06:34
@twyatt
twyatt requested a review from a team as a code owner July 23, 2026 06:34
@twyatt
twyatt requested review from davertay-j and sdonn3 July 23, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Changes that should bump the PATCH version number

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant