Files
EasyFlow/easyflow-ui-admin/packages/tinyflow-ui/src/components/utils/IdGen.ts
陈子默 8cfe5400fe feat: 优化工作流字段化参数配置
- 开始节点固定 user_input 并区分系统入口与自定义参数

- LLM 与知识库节点切换为字段值加上游引用配置

- 单节点调试改为字段预览与上游引用输入模式
2026-04-12 20:31:02 +08:00

17 lines
514 B
TypeScript

export const genShortId = (length = 16) => {
const chars =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
const array = new Uint8Array(length);
crypto.getRandomValues(array);
return Array.from(array, (byte) => chars[byte % chars.length]).join('');
};
export const genUuid = () => {
return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c: any) =>
(
c ^
((crypto.getRandomValues(new Uint8Array(1))[0] ?? 0) & (15 >> (c / 4)))
).toString(16),
);
};