[#BloombergLP-bslalg-HashTableImpUtil-computeBucketIndex]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/HashTableImpUtil.adoc[HashTableImpUtil]::computeBucketIndex
:relfileprefix: ../../../
:mrdocs:

Return the bucket index for the specified `hashCode`&period;

== Synopsis

Declared in `&lt;bslalg&lowbar;hashtableimputil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
std::size&lowbar;t
computeBucketIndex(
    std::size&lowbar;t hashCode,
    std::size&lowbar;t numBuckets);
----

== Description

Return the index of the bucket referring to the elements whose adjusted hash codes are the same as the adjusted value of the specified `hashCode`, where `hashCode` (and the hash&hyphen;codes of the elements) are adjusted for the specified `numBuckets`&period; The behavior is undefined if `numBuckets` is 0&period;

== Return Value

index of the bucket for the adjusted `hashCode`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *hashCode*
| non&hyphen;adjusted hash code to map onto a bucket
| *numBuckets*
| number of buckets in the table&semi; must not be 0
|===


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