MCPcopy Create free account
hub / github.com/winfunc/opcode / generateAnonymousId

Method generateAnonymousId

src/lib/analytics/consent.ts:124–131  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122 }
123
124 private generateAnonymousId(): string {
125 // Generate a UUID v4
126 return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
127 const r = (Math.random() * 16) | 0;
128 const v = c === 'x' ? r : (r & 0x3) | 0x8;
129 return v.toString(16);
130 });
131 }
132
133 private generateSessionId(): string {
134 // Simple session ID based on timestamp and random value

Callers 3

initializeMethod · 0.95
deleteAllDataMethod · 0.95
getUserIdMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected