[#absl-HexStringToBytes-08]
= xref:absl.adoc[absl]::HexStringToBytes
:relfileprefix: ../
:mrdocs:

`HexStringToBytes` overloads

== Synopses

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

Converts an ASCII hex string into bytes, returning binary data of length `from&period;size()&sol;2`&period; The input must be valid hexadecimal data, otherwise the return value is unspecified&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;deprecated(&quot;Use the HexStringToBytes() that returns a bool&quot;)&rsqb;&rsqb;
std::string
xref:absl/HexStringToBytes-02.adoc[HexStringToBytes](std::string&lowbar;view from);
----

[.small]#xref:absl/HexStringToBytes-02.adoc[_» more&period;&period;&period;_]#

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;


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

[.small]#xref:absl/HexStringToBytes-05.adoc[_» more&period;&period;&period;_]#

== Return Value

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *from*
| The hexadecimal&hyphen;encoded string to decode&period;
| *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]#
