[#detail-FromHex]
= xref:detail.adoc[detail]::FromHex
:relfileprefix: ../
:mrdocs:

Writes the hex string (in reverse byte order) into a new uintN&lowbar;t object and only returns a value iff all of the checks pass&colon; &hyphen; Input length is uintN&lowbar;t&colon;&colon;size()&ast;2 &hyphen; All characters are hex

== Synopsis

Declared in `&lt;uint256&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class uintN&lowbar;t&gt;
std::optional&lt;uintN&lowbar;t&gt;
FromHex(std::string&lowbar;view str);
----

== Return Value

The parsed value, or std&colon;&colon;nullopt if the length or characters are invalid&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *str*
| The hex string to parse, expected to be uintN&lowbar;t&colon;&colon;size()&ast;2 characters&period;
|===


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