propapier/app/utils/uuid.ts
webfussel 11bcdce6cb add: new list layout design
New design, custom uuid, better handling of swipe
2025-05-10 13:32:28 +02:00

7 lines
235 B
TypeScript

export const randomUUID = (): string => {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
const r = Math.random() * 16 | 0;
const v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
})
}