[#BloombergLP-bdlb-HashUtil-hash1-05]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/HashUtil.adoc[HashUtil]::hash1
:relfileprefix: ../../../
:mrdocs:

Return a 32&hyphen;bit hash value for the specified `data` of the specified `length`&period;

== Synopsis

Declared in `&lt;bdlb&lowbar;hashutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
unsigned int
hash1(
    char const* data,
    int length);
----

== Description

Return an unsigned integer hash value corresponding to the specified `data` of the specified `length` (in bytes)&period; The behavior is undefined unless `0 &lt;&equals; length`&period; Note that if `data` is 0, then `length` also must be 0&period; Also note that every byte in `data` is significant&semi; that is, it is not appropriate to cast a `struct` address to a `char &ast;` unless the `struct` is packed (no padding)&period;

Both `hash1` and `hash2` return a hash, but both hashes can be assumed to be independent (i&period;e&period;, there are no known correlations between the results of the two hash functions given the same input data)&period;

== Return Value

32&hyphen;bit hash value for `data`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *data*
| bytes to hash
| *length*
| number of bytes in `data`
|===


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