[#BloombergLP-bslh-hashAppend-043]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslh.adoc[bslh]::hashAppend
:relfileprefix: ../../
:mrdocs:

Combine an optional value into the state of a hash algorithm&period;

== Synopsis

Declared in `&lt;bslh&lowbar;hashoptional&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class HASH&lowbar;ALGORITHM,
    class TYPE&gt;
void
hashAppend(
    HASH&lowbar;ALGORITHM& algorithm,
    std::optional&lt;TYPE&gt; const& input);
----

== Description

If the specified `input` is engaged, pass its contained value into the specified `algorithm` to be combined into the internal state of the algorithm that is used to produce the resulting hash value&period; Otherwise, pass an arbitrary `size&lowbar;t` value instead&period; Note that this behavior (for engaged values) is required by the C&plus;&plus; Standard&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *algorithm*
| hashing algorithm into which the value is combined
| *input*
| optional value whose contents are hashed when engaged
|===


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