import { randomBytes as cryptoRandomBytes } from 'node:crypto';
export function generateWebhookSecret(randomBytes = cryptoRandomBytes) {
    return randomBytes(32).toString('hex');
}
export function truncateSecret(secret, displayLength) {
    if (secret.length <= displayLength)
        return secret;
    return `${secret.slice(0, displayLength)}...`;
}
export function isValidSecret(secret) {
    return /^[0-9a-f]{64}$/.test(secret);
}
//# sourceMappingURL=secretGenerator.js.map