mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-02 17:57:06 +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()}`;
|
|
}
|