function · Browser and Node

# encodeMembershipCode

Crockford base32 of the 31-byte secret and a 2-byte checksum over (groupId, secret), in groups of 4.

`@toip-tools/anon-membership` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/anon-membership/src/encode.ts#L107)

Import:

```ts
import { encodeMembershipCode } from "@toip-tools/anon-membership";
```

## Declaration

Signature:

```ts
encodeMembershipCode(secret: Field, groupId: string): string;
```

### Parameters

- **`secret` (required)**: `bigint`
- **`groupId` (required)**: `string`

### Returns

`string`

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

---

This is the Markdown version of https://toip.tools/toolkit/anon-membership/api/encodeMembershipCode/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
