[#absl-HexStringToBytes-08] = xref:absl.adoc[absl]::HexStringToBytes :relfileprefix: ../ :mrdocs: `HexStringToBytes` overloads == Synopses Declared in `<absl/strings/escaping.h>` Converts an ASCII hex string into bytes, returning binary data of length `from.size()/2`. The input must be valid hexadecimal data, otherwise the return value is unspecified. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[deprecated("Use the HexStringToBytes() that returns a bool")]] std::string xref:absl/HexStringToBytes-02.adoc[HexStringToBytes](std::string_view from); ---- [.small]#xref:absl/HexStringToBytes-02.adoc[_» more..._]# 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] bool xref:absl/HexStringToBytes-05.adoc[HexStringToBytes]( std::string_view hex, std::string* bytes); ---- [.small]#xref:absl/HexStringToBytes-05.adoc[_» more..._]# == Return Value * The decoded binary data. * `true` on success, `false` if `hex` is not valid hexadecimal data. == Parameters [cols="1,4"] |=== | Name| Description | *from* | The hexadecimal‐encoded string to decode. | *hex* | The hexadecimal‐encoded string to decode. | *bytes* | The output string that receives the decoded bytes. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#