mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-21 18:04:39 -05:00
16 lines
308 B
TypeScript
16 lines
308 B
TypeScript
import { customAlphabet } from "nanoid";
|
|
|
|
const nanoid = customAlphabet(
|
|
// avoid 1/I and 0/O
|
|
"23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
);
|
|
|
|
let sessionId: string | undefined;
|
|
|
|
export function getSessionId(): string {
|
|
if (!sessionId) {
|
|
sessionId = nanoid(10);
|
|
}
|
|
return sessionId;
|
|
}
|