mirror of
https://github.com/oxen-io/oxen-mq.git
synced 2023-12-13 21:00:31 +01:00
90701e5d62
`is_hex()` is a bit misleading as `from_hex()` requires an even-length hex string, but `is_hex()` also allows odd-length hex strings, which means currently callers should be doing `if (lokimq::is_hex(str) && str.size() % 2 == 0)`, but probably aren't. Since the main point of `lokimq/hex.h` is for byte<->hex conversions it doesn't make much sense to allow `is_hex()` to return true for something that can't be validly decoded via `from_hex()`, thus this PR changes it to return false. If someone *really* wants to test for an odd-length hex string (though I'm skeptical that there is a need for this), this also exposes `is_hex_digit` so that they could use: bool all_hex = std::all_of(str.begin(), str.end(), lokimq::is_hex_digit<char>) |
||
---|---|---|
.. | ||
Catch2@b3b07215d1 | ||
CMakeLists.txt | ||
common.h | ||
main.cpp | ||
test_address.cpp | ||
test_batch.cpp | ||
test_bt.cpp | ||
test_commands.cpp | ||
test_connect.cpp | ||
test_encoding.cpp | ||
test_failures.cpp | ||
test_inject.cpp | ||
test_requests.cpp | ||
test_tagged_threads.cpp |