mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 02:08:57 +00:00
13 lines
375 B
TypeScript
13 lines
375 B
TypeScript
// Copyright 2025 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
const VALID_PACK_ID_REGEXP = /^[0-9a-f]{32}$/i;
|
|
|
|
export function isPackIdValid(packId: unknown): packId is string {
|
|
return typeof packId === 'string' && VALID_PACK_ID_REGEXP.test(packId);
|
|
}
|
|
|
|
export function redactPackId(packId: string): string {
|
|
return `[REDACTED]${packId.slice(-3)}`;
|
|
}
|