mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-10 06:39:15 +02:00
Merge bitcoin/bitcoin#23595: util: Add ParseHex<std::byte>() helper
facd1fb911refactor: Use Span of std::byte in CExtKey::SetSeed (MarcoFalke)fae1006019util: Add ParseHex<std::byte>() helper (MarcoFalke)fabdf81983test: Add test for embedded null in hex string (MarcoFalke) Pull request description: This adds the hex->`std::byte` helper after the `std::byte`->hex helper was added in commit9394964f6bACKs for top commit: pk-b2: ACKfacd1fb911laanwj: Code review ACKfacd1fb911Tree-SHA512: e2329fbdea2e580bd1618caab31f5d0e59c245a028e1236662858e621929818870b76ab6834f7ac6a46d7874dfec63f498380ad99da6efe4218f720a60e859be
This commit is contained in:
@@ -25,6 +25,8 @@ FUZZ_TARGET_INIT(hex, initialize_hex)
|
||||
{
|
||||
const std::string random_hex_string(buffer.begin(), buffer.end());
|
||||
const std::vector<unsigned char> data = ParseHex(random_hex_string);
|
||||
const std::vector<std::byte> bytes{ParseHex<std::byte>(random_hex_string)};
|
||||
assert(AsBytes(Span{data}) == Span{bytes});
|
||||
const std::string hex_data = HexStr(data);
|
||||
if (IsHex(random_hex_string)) {
|
||||
assert(ToLower(random_hex_string) == hex_data);
|
||||
|
||||
Reference in New Issue
Block a user