toip.tools

function · Browser and Node

makeBody

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

@toip-tools/eventlogView source
TypeScriptImport
import { makeBody } from "@toip-tools/eventlog";

Declaration

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

Parameters

fieldsrequired
Record<string, unknown>
randomoptional
(n: number) => Uint8Array

Default: randomBytes

Returns

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

Returned object

The returned object exposes these properties and methods.

Properties

bodyrequired
Body
saidrequired
string
rawrequired
string