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

Like FromHex(std&colon;&colon;string&lowbar;view str), but allows an &quot;0x&quot; prefix and pads the input with leading zeroes if it is shorter than the expected length of uintN&lowbar;t&colon;&colon;size()&ast;2&period;

== 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;
FromUserHex(std::string&lowbar;view input);
----

== Description

Designed to be used when dealing with user input&period;

== Return Value

The parsed value, or std&colon;&colon;nullopt if the input is invalid&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *input*
| The hex string to parse, optionally prefixed with &quot;0x&quot;&period;
|===


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