MCPcopy Create free account
hub / github.com/dailydotdev/apps / anonymousDisplayName

Function anonymousDisplayName

packages/shared/src/lib/liveRoom/anonymousName.ts:89–94  ·  view source on GitHub ↗
(participantId: string)

Source from the content-addressed store, hash-verified

87};
88
89export const anonymousDisplayName = (participantId: string): string => {
90 const hash = hashString(participantId);
91 const adjective = ADJECTIVES[hash % ADJECTIVES.length];
92 const animal = ANIMALS[Math.floor(hash / ADJECTIVES.length) % ANIMALS.length];
93 return `${adjective} ${animal}`;
94};
95
96export const anonymousHandle = (participantId: string): string =>
97 anonymousDisplayName(participantId).toLowerCase().replace(/\s+/g, '-');

Callers 2

buildParticipantProfileFunction · 0.90
anonymousHandleFunction · 0.85

Calls 1

hashStringFunction · 0.70

Tested by

no test coverage detected