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

`hashAppend` overloads

== Synopses

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

Pass the specified `input` path to the specified `hashAlg` hashing algorithm of the (template parameter) type `HASHALG`&period; Note that this function violates the BDE coding standard, adding a function for a namespace for a different package, and none of the function parameters are from this package either&period; This is necessary in order to provide an implementation of `bslh&colon;&colon;hashAppend` for the (native) standard library `std&colon;&colon;filesystem&colon;&colon;path` type as we are not allowed to add overloads directly into namespace `std`&period; Also note that this will NOT be found by the compiler if HASHALG is not in `BloombergLP&colon;&colon;bslh`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class HASHALG&gt;
void
xref:BloombergLP/bslh/hashAppend-08c.adoc[hashAppend](
    HASHALG& hashAlg,
    std::filesystem::path const& path);
----

[.small]#xref:BloombergLP/bslh/hashAppend-08c.adoc[_» more&period;&period;&period;_]#

Pass the special value corresponding to the `std&colon;&colon;monostate` object to the specified `algorithm`&period; This function integrates with the `bslh` modular hashing system and effectively provides a `bsl&colon;&colon;hash` specialization for `std&colon;&colon;monostate`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class HASH&lowbar;ALGORITHM&gt;
void
xref:BloombergLP/bslh/hashAppend-04c.adoc[hashAppend](
    HASH&lowbar;ALGORITHM& algorithm,
    std::monostate const&);
----

[.small]#xref:BloombergLP/bslh/hashAppend-04c.adoc[_» more&period;&period;&period;_]#

Invoke `hashAppend` with the specified `algorithm` as the first argument and the result of applying an unspecified function to the specified `tid` as the second argument&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;HASH&lowbar;ALG&gt;
void
xref:BloombergLP/bslh/hashAppend-03c.adoc[hashAppend](
    t&lowbar;HASH&lowbar;ALG& algorithm,
    std::thread::id const& tid);
----

[.small]#xref:BloombergLP/bslh/hashAppend-03c.adoc[_» more&period;&period;&period;_]#

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;


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

[.small]#xref:BloombergLP/bslh/hashAppend-043.adoc[_» more&period;&period;&period;_]#

Invoke `hashAppend`, with the specified `algorithm`, on each element of the specified `input` in order of increasing index as defined by `std&colon;&colon;get`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class HASH&lowbar;ALGORITHM,
    class&period;&period;&period; TYPE&gt;
void
xref:BloombergLP/bslh/hashAppend-07.adoc[hashAppend](
    HASH&lowbar;ALGORITHM& algorithm,
    std::tuple&lt;TYPE&period;&period;&period;&gt; const& input);
----

[.small]#xref:BloombergLP/bslh/hashAppend-07.adoc[_» more&period;&period;&period;_]#

Pass the index of the active variant of the specified `input` to the specified `algorithm`, followed by the active value itself, to be combined into the internal state of the algorithm that is used to produce the resulting hash value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class HASH&lowbar;ALGORITHM,
    class&period;&period;&period; TYPE&gt;
void
xref:BloombergLP/bslh/hashAppend-058.adoc[hashAppend](
    HASH&lowbar;ALGORITHM& algorithm,
    std::variant&lt;TYPE&period;&period;&period;&gt; const& input);
----

[.small]#xref:BloombergLP/bslh/hashAppend-058.adoc[_» more&period;&period;&period;_]#

Passes the specified `input` into the specified `hashAlg` to be combined into the internal state of the algorithm which is used to produce the resulting hash value&period; Note that the `enable&lowbar;if` meta&hyphen;function is used to enable this `hashAppend` function for only integral (excluding `bool`), pointer, and enum types, because these types can all be hashed as a continuous sequence of bytes&period; Also note that this function is defined inline because MS Visual Studio compilers before 2013 require (some) functions declared using enable&lowbar;if be in&hyphen;place inline&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class HASH&lowbar;ALGORITHM,
    class TYPE&gt;
void
xref:BloombergLP/bslh/hashAppend-032.adoc[hashAppend](
    HASH&lowbar;ALGORITHM& hashAlg,
    TYPE input)
requires (bsl&colon;&colon;is&lowbar;integral&lt;TYPE&gt;&colon;&colon;value &verbar;&verbar;
     bsl&colon;&colon;is&lowbar;pointer&lt;TYPE&gt;&colon;&colon;value  &verbar;&verbar;
     bsl&colon;&colon;is&lowbar;enum&lt;TYPE&gt;&colon;&colon;value)    &amp;&amp;
    !bsl&colon;&colon;is&lowbar;same&lt;TYPE, bool&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bslh/hashAppend-032.adoc[_» more&period;&period;&period;_]#

Passes the specified `input` into the specified `hashAlg` to be combined into the internal state of the algorithm which is used to produce the resulting hash value&period; Note that the `enable&lowbar;if` meta&hyphen;function is used to enable this `hashAppend` function for only floating point (excluding `long double`) types, because these types need to have &plus;&sol;&hyphen;0&period;0 normalized to 0&period;0 before they can be hashed as a continuous sequence of bytes&period; Also note that this function is defined inline because MS Visual Studio compilers before 2013 require (some) functions declared using enable&lowbar;if be in&hyphen;place inline&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class HASH&lowbar;ALGORITHM,
    class TYPE&gt;
void
xref:BloombergLP/bslh/hashAppend-082.adoc[hashAppend](
    HASH&lowbar;ALGORITHM& hashAlg,
    TYPE input)
requires bsl&colon;&colon;is&lowbar;floating&lowbar;point&lt;TYPE&gt;&colon;&colon;value &amp;&amp;
   !bsl&colon;&colon;is&lowbar;same&lt;TYPE, long double&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bslh/hashAppend-082.adoc[_» more&period;&period;&period;_]#

Passes the specified `input` into the specified `hashAlg` to be combined into the internal state of the algorithm which is used to produce the resulting hash value&period; Note that the `enable&lowbar;if` meta&hyphen;function is used to enable this `hashAppend` function for only `bool`, because `bool`s can have multiple `true` representations and need to be normalized before they can be hashed as a continuous sequence of bytes&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class HASH&lowbar;ALGORITHM,
    class TYPE&gt;
void
xref:BloombergLP/bslh/hashAppend-086.adoc[hashAppend](
    HASH&lowbar;ALGORITHM& hashAlg,
    TYPE input)
requires bsl&colon;&colon;is&lowbar;same&lt;TYPE, bool&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bslh/hashAppend-086.adoc[_» more&period;&period;&period;_]#

Passes the specified `input` into the specified `hashAlg` to be combined into the internal state of the algorithm which is used to produce the resulting hash value&period; Note that the `enable&lowbar;if` meta&hyphen;function is used to enable this `hashAppend` function for only `long double`, because on some compilers `long double`s contain garbage and can not be hashed as a continuous sequence of bytes&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class HASH&lowbar;ALGORITHM,
    class TYPE&gt;
void
xref:BloombergLP/bslh/hashAppend-056.adoc[hashAppend](
    HASH&lowbar;ALGORITHM& hashAlg,
    TYPE input)
requires bsl&colon;&colon;is&lowbar;same&lt;TYPE, long double&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bslh/hashAppend-056.adoc[_» more&period;&period;&period;_]#

Passes the specified `input` into the specified `hashAlg` to be combined into the internal state of the algorithm which is used to produce the resulting hash value&period; Note that the entire `char` array will be hashed in only one call to `hashAlg`&period; Also note that this `hashAppend` exists because some platforms don&apos;t recognize that adding a const qualifier is a better match for arrays than decaying to a pointer and using the `hashAppend` function for pointers&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class HASH&lowbar;ALGORITHM,
    size&lowbar;t N&gt;
void
xref:BloombergLP/bslh/hashAppend-0f6.adoc[hashAppend](
    HASH&lowbar;ALGORITHM& hashAlg,
    char(& input)[]);
----

[.small]#xref:BloombergLP/bslh/hashAppend-0f6.adoc[_» more&period;&period;&period;_]#

Passes the specified `input` into the specified `hashAlg` to be combined into the internal state of the algorithm which is used to produce the resulting hash value&period; Note that the entire `char` array will be hashed in only one call to `hashAlg`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class HASH&lowbar;ALGORITHM,
    size&lowbar;t N&gt;
void
xref:BloombergLP/bslh/hashAppend-0f1.adoc[hashAppend](
    HASH&lowbar;ALGORITHM& hashAlg,
    char const(& input)[]);
----

[.small]#xref:BloombergLP/bslh/hashAppend-0f1.adoc[_» more&period;&period;&period;_]#

Pass the specified `input` string to the specified `hashAlg` hashing algorithm of the (template parameter) type `HASHALG`&period; Note that this function violates the BDE coding standard, adding a function for a namespace for a different package, and none of the function parameters are from this package either&period; This is necessary in order to provide an implementation of `bslh&colon;&colon;hashAppend` for the (native) standard library `string&lowbar;view` type as we are not allowed to add overloads directly into namespace `std`, and this component essentially provides the interface between `bsl` and `std` string types&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class HASHALG,
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS&gt;
void
xref:BloombergLP/bslh/hashAppend-037.adoc[hashAppend](
    HASHALG& hashAlg,
    std::basic&lowbar;string&lowbar;view&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS&gt; const& input);
----

[.small]#xref:BloombergLP/bslh/hashAppend-037.adoc[_» more&period;&period;&period;_]#

Invoke the (appropriate) `hashAppend` function, with the specified `algorithm` on the `first` and `second` members, in that order, of the specified `input` pair&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class HASH&lowbar;ALGORITHM,
    class TYPE1,
    class TYPE2&gt;
void
xref:BloombergLP/bslh/hashAppend-0f38.adoc[hashAppend](
    HASH&lowbar;ALGORITHM& algorithm,
    std::pair&lt;TYPE1, TYPE2&gt; const& input);
----

[.small]#xref:BloombergLP/bslh/hashAppend-0f38.adoc[_» more&period;&period;&period;_]#

Passes the specified `input` into the specified `hashAlg` to be combined into the internal state of the algorithm which is used to produce the resulting hash value&period; Note that the elements in `input` will be hashed one at a time by calling `hashAppend` because the (template parameter) `TYPE` might not be hashable as a contiguous sequence of bytes&period; Also note that this `hashAppend` exists because some platforms don&apos;t recognize that adding a const qualifier is a better match for arrays than decaying to a pointer and using the `hashAppend` function for pointers&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class HASH&lowbar;ALGORITHM,
    class TYPE,
    size&lowbar;t N&gt;
void
xref:BloombergLP/bslh/hashAppend-0b.adoc[hashAppend](
    HASH&lowbar;ALGORITHM& hashAlg,
    TYPE(& input)[]);
----

[.small]#xref:BloombergLP/bslh/hashAppend-0b.adoc[_» more&period;&period;&period;_]#

Passes the specified `input` into the specified `hashAlg` to be combined into the internal state of the algorithm which is used to produce the resulting hash value&period; Note that the elements in `input` will be hashed one at a time by calling `hashAppend` because the (template parameter) `TYPE` might not be hashable as a contiguous sequence of bytes&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class HASH&lowbar;ALGORITHM,
    class TYPE,
    size&lowbar;t N&gt;
void
xref:BloombergLP/bslh/hashAppend-0f39.adoc[hashAppend](
    HASH&lowbar;ALGORITHM& hashAlg,
    TYPE const(& input)[]);
----

[.small]#xref:BloombergLP/bslh/hashAppend-0f39.adoc[_» more&period;&period;&period;_]#

Pass the specified `input` to the specified `hashAlgorithm` hashing algorithm of the (template parameter) type `HASH&lowbar;ALGORITHM`&period; Note that this function violates the BDE coding standard, adding a function for a namespace for a different package, and none of the function parameters are from this package either&period; This is necessary in order to provide an implementation of `bslh&colon;&colon;hashAppend` for the (native) standard library `array` type as we are not allowed to add overloads directly into namespace `std`, and this component essentially provides the interface between `bsl` and `std` array types&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class HASH&lowbar;ALGORITHM,
    class TYPE,
    size&lowbar;t SIZE&gt;
void
xref:BloombergLP/bslh/hashAppend-0a.adoc[hashAppend](
    HASH&lowbar;ALGORITHM& hashAlgorithm,
    std::array&lt;TYPE, SIZE&gt; const& input);
----

[.small]#xref:BloombergLP/bslh/hashAppend-0a.adoc[_» more&period;&period;&period;_]#

Pass the specified `input` string to the specified `hashAlg` hashing algorithm of the (template parameter) type `HASHALG`&period; Note that this function violates the BDE coding standard, adding a function for a namespace for a different package, and none of the function parameters are from this package either&period; This is necessary in order to provide an implementation of `bslh&colon;&colon;hashAppend` for the (native) standard library `string` type as we are not allowed to add overloads directly into namespace `std`, and this component essentially provides the interface between `bsl` and `std` string types&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class HASHALG,
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR&gt;
void
xref:BloombergLP/bslh/hashAppend-034.adoc[hashAppend](
    HASHALG& hashAlg,
    std::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt; const& input);
----

[.small]#xref:BloombergLP/bslh/hashAppend-034.adoc[_» more&period;&period;&period;_]#


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