teableio/teable

View on GitHub
apps/nestjs-backend/src/utils/code-generate.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { createHmac } from 'crypto';
import { baseConfig } from '../configs/base.config';

export const generateInvitationCode = (invitationId: string) => {
  const hmac = createHmac('sha256', baseConfig().secretKey);
  return hmac.update(invitationId).digest('hex');
};