workflow底层UI库整合至项目,优化构建逻辑
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
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] & (15 >> (c / 4)))).toString(16)
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user