File size: 204 Bytes
473db3d
 
 
 
 
 
 
1
2
3
4
5
6
7
8
import { randomBytes } from 'crypto';

export function generateApiKey(): string {
  const prefix = 'ak';
  const randomPart = randomBytes(24).toString('hex');
  return `${prefix}_${randomPart}`;
}