<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/transform/blob/v1.21.0/tensorflow_transform/mappers.py#L1839-L1885) |

Hash strings into buckets.

    tft.hash_strings(
        strings: common_types.ConsistentTensorType,
        hash_buckets: int,
        key: Optional[Iterable[int]] = None,
        name: Optional[str] = None
    ) -> common_types.ConsistentTensorType

<br />

<br />

<br />

| ## Args ||
|---|---|

<br />

*** ** * ** ***

strings: a `Tensor`, `SparseTensor`, or `RaggedTensor` of dtype [`tf.string`](https://www.tensorflow.org/api_docs/python/tf#string).
hash_buckets: the number of hash buckets.
key: optional. An array of two Python `uint64`. If passed, output will be a
deterministic function of `strings` and `key`. Note that hashing will be
slower if this value is specified.
name: (Optional) A name for this operation.

<br />

<br />

<br />

| ## Returns ||
|---|---|

<br />

*** ** * ** ***

A `Tensor`, `SparseTensor`, or `RaggedTensor` of dtype [`tf.int64`](https://www.tensorflow.org/api_docs/python/tf#int64) with the
same shape as
the input `strings`.

<br />

<br />

<br />

| ## Raises ||
|---|---|

<br />

*** ** * ** ***

TypeError: if `strings` is not a `Tensor`, `SparseTensor`, or `RaggedTensor`
of dtype [`tf.string`](https://www.tensorflow.org/api_docs/python/tf#string).