# bytes32

> **bytes32**(`value`): [`Bytes32Value`](https://docs.arkiv.network/typescript-sdk/api-reference/main/type-aliases/bytes32value/)

Defined in: [src/attr/values.ts:369](https://github.com/Arkiv-Network/arkiv-sdk-js/blob/5182f6d142de34497e0057b9fb39dce64f96f65a/src/attr/values.ts#L369)

32 opaque bytes — a hash, a digest, an identifier from another system — indexed for equality.

Use [key](https://docs.arkiv.network/typescript-sdk/api-reference/main/functions/key/) instead when the bytes are an Arkiv entity key: same wire width, but the
distinct type makes the reference visible to readers and to the query language.

## Parameters

### value

32 bytes, as `0x` hex or raw bytes.

`` `0x${string}` `` | `Uint8Array`\<`ArrayBufferLike`\>

## Returns

[`Bytes32Value`](https://docs.arkiv.network/typescript-sdk/api-reference/main/type-aliases/bytes32value/)

## Throws

If the value is not exactly 32 bytes.

## Example

```ts
bytes32(keccak256(toBytes("hello")))
```