function · Browser and Node

# makeBody

Makes a body: adds a random salt `u` and its SAID `d`. Serialized with JCS.

`@toip-tools/eventlog` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/eventlog/src/said.ts#L181)

Import:

```ts
import { makeBody } from "@toip-tools/eventlog";
```

## Declaration

Signature:

```ts
makeBody(fields: Record<string, unknown>, random?: (n: number) => Uint8Array): {
    body: Body;
    said: Qb64;
    raw: string;
};
```

### Parameters

**`fields` (required)**

`Record<string, unknown>`

**`random` (optional)**

`(n: number) => Uint8Array`

Default: `randomBytes`

### Returns

`{ body: Body; said: Qb64; raw: string; }`

## Returned object

The returned object exposes these properties and methods.

## Properties

- **`body` (required)**: `Body`
- **`said` (required)**: `string`
- **`raw` (required)**: `string`

[Usage guide](https://toip.tools/toolkit/eventlog/#usage) · [Error handling](https://toip.tools/toolkit/eventlog/#errors) · [All exports](https://toip.tools/toolkit/eventlog/api/)

---

This is the Markdown version of https://toip.tools/toolkit/eventlog/api/makeBody/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
