---
title: "ClikaRT::ops::hash_chain"
sidebar_label: "hash_chain"
description: "Rowwise 128-bit CHAINED hash: for rows [N, ..] and a [2] UInt64 parent (zeros = the chain's zero element), row i's digest hashes (digest i-1 ‖ row i's packed bytes); one dispatch computes a whole sequ…"
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--function">function</span>

## hash\_chain() {#hash_chain}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`hash_chain`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `rows`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `parent`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`std::uint64_t` `seed` `=` `0`<br />
)

</div>

Rowwise 128-bit CHAINED hash: for `rows [N, ..]` and a `[2]` UInt64 `parent` (zeros = the chain's zero element), row `i`'s digest hashes (digest `i-1` ‖ row `i`'s packed bytes); one dispatch computes a whole sequence's rolling content hashes. Same portability contract as [`hash_64`](./hash_64.md#hash_64).

**Parameters**

- `rows`: `[N, ..]`, any byte-aligned dtype.
- `parent`: `[2]` UInt64 chain seed; zeros start a fresh chain.
- `seed`: key perturbation; 0 = the fixed content-addressing key.

**Returns:** `[N, 2]` UInt64; row `i` is the chain digest through row `i`.

**Throws**

- `ClikaRT::Error`: (`INVALID_ARGUMENT`) when `parent` is not `[2]` UInt64 (`code_name()` carries the reason).

<div class="api-declared">

Declared in `ClikaRT/compute/ops.h`, line 4504

</div>
