Files
stats/packages/common/src/id.ts
Carl-Gerhard Lindesvärd aa81bbfe77 feat: session replay
* wip

* wip

* wip

* wip

* final fixes

* comments

* fix
2026-02-26 14:09:53 +01:00

10 lines
237 B
TypeScript

import { nanoid } from 'nanoid/non-secure';
export function shortId() {
return nanoid(4);
}
export function generateId(prefix?: string, length?: number) {
return prefix ? `${prefix}_${nanoid(length ?? 8)}` : nanoid(length ?? 8);
}