Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿

feat: use crypto.randomUUID (#5873)

authored by yoginth.com and committed by

GitHub d8da1681 db19d8f1

+2 -6
+2 -6
packages/helpers/generateUUID.ts
··· 1 - const generateUUID = () => { 2 - return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => { 3 - const r = (Math.random() * 16) | 0; 4 - const v = c === "x" ? r : (r & 0x3) | 0x8; 5 - return v.toString(16); 6 - }); 1 + const generateUUID = (): string => { 2 + return crypto.randomUUID(); 7 3 }; 8 4 9 5 export default generateUUID;