mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
14 lines
351 B
TypeScript
14 lines
351 B
TypeScript
import { customAlphabet } from 'nanoid';
|
|
import { ALPHABET } from 'n8n-workflow';
|
|
import type { N8nInstanceType } from '@/Interfaces';
|
|
|
|
const nanoid = customAlphabet(ALPHABET, 16);
|
|
|
|
export function generateNanoId() {
|
|
return nanoid();
|
|
}
|
|
|
|
export function generateHostInstanceId(instanceType: N8nInstanceType) {
|
|
return `${instanceType}-${nanoid()}`;
|
|
}
|