mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-07-16 01:47:20 +02:00
14 lines
347 B
TypeScript
14 lines
347 B
TypeScript
import type { InstanceType } from '@n8n/constants';
|
|
import { ALPHABET } from 'n8n-workflow';
|
|
import { customAlphabet } from 'nanoid';
|
|
|
|
const nanoid = customAlphabet(ALPHABET, 16);
|
|
|
|
export function generateNanoId() {
|
|
return nanoid();
|
|
}
|
|
|
|
export function generateHostInstanceId(instanceType: InstanceType) {
|
|
return `${instanceType}-${nanoid()}`;
|
|
}
|