[#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&period; If `hex` does not consist of valid hexadecimal data, this function returns false and leaves `bytes` in an unspecified state&period; Returns true on success&period;

== Synopsis

Declared in `&lt;absl&sol;strings&sol;escaping&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
bool
HexStringToBytes(
    std::string&lowbar;view hex,
    std::string* bytes);
----

== Return Value

`true` on success, `false` if `hex` is not valid hexadecimal data&period;

[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&hyphen;encoded string to decode&period;
| *bytes*
| The output string that receives the decoded bytes&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
