Files
libsignal/node/ts/zkgroup/groups/GroupIdentifier.ts
2026-03-16 18:55:17 -07:00

22 lines
577 B
TypeScript

//
// Copyright 2020-2021 Signal Messenger, LLC.
// SPDX-License-Identifier: AGPL-3.0-only
//
import ByteArray from '../internal/ByteArray.js';
import { Buffer } from 'node:buffer';
export default class GroupIdentifier extends ByteArray {
private readonly __type?: never;
static SIZE = 32;
constructor(contents: Uint8Array<ArrayBuffer>) {
super(contents, GroupIdentifier.checkLength(GroupIdentifier.SIZE));
}
/** Returns the group ID as a base64 string (with padding). */
toString(): string {
return Buffer.from(this.contents).toString('base64');
}
}