[#absl-HexStringToBytes-05] = xref:absl.adoc[absl]::HexStringToBytes :relfileprefix: ../ :mrdocs: Converts the hexadecimal encoded data in `hex` into raw bytes in the `bytes` output string. If `hex` does not consist of valid hexadecimal data, this function returns false and leaves `bytes` in an unspecified state. Returns true on success. == Synopsis Declared in `<absl/strings/escaping.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] bool HexStringToBytes( std::string_view hex, std::string* bytes); ---- == Return Value `true` on success, `false` if `hex` is not valid hexadecimal data. [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *hex* | The hexadecimal‐encoded string to decode. | *bytes* | The output string that receives the decoded bytes. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#