Rocky_Mountain_Vending/.pnpm-store/v10/files/f2/7f72243d1114bd4cf845c2df06b396d62b5fcde53e523e57e7b4fb3ff6e09851a7c88ec91a46424f9f62e73b3715c8398992dda1b59afe422874b03d038120
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

31 lines
949 B
Text

import { randomUUID } from "./randomUUID";
const decimalToHex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
export const v4 = () => {
if (randomUUID) {
return randomUUID();
}
const rnds = new Uint8Array(16);
crypto.getRandomValues(rnds);
rnds[6] = (rnds[6] & 0x0f) | 0x40;
rnds[8] = (rnds[8] & 0x3f) | 0x80;
return (decimalToHex[rnds[0]] +
decimalToHex[rnds[1]] +
decimalToHex[rnds[2]] +
decimalToHex[rnds[3]] +
"-" +
decimalToHex[rnds[4]] +
decimalToHex[rnds[5]] +
"-" +
decimalToHex[rnds[6]] +
decimalToHex[rnds[7]] +
"-" +
decimalToHex[rnds[8]] +
decimalToHex[rnds[9]] +
"-" +
decimalToHex[rnds[10]] +
decimalToHex[rnds[11]] +
decimalToHex[rnds[12]] +
decimalToHex[rnds[13]] +
decimalToHex[rnds[14]] +
decimalToHex[rnds[15]]);
};