# hashBucket {#hashbucket}

**Parent topic:**[Functions](../../Functions/category.md)

## Syntax {#syntax}

`hashBucket(X, buckets)`

## Arguments {#arguments}

**X** is a scalar/vector.

**buckets** is a positive integer.

## Details {#details}

Hashes each element in *X* into one of the specified number of buckets and returns the corresponding bucket index.

## Examples {#examples}

```
hashBucket(34 45 67, 10);
// output: [4,5,7]

hashBucket(`AAPL`TSLA`GS`MS`GE`BA`UAL`WMT, 10);
// output: [9,4,1,8,3,7,5,2]
```

