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

Function hashEmailForMeta

packages/webapp/components/Pixels.tsx:34–51  ·  view source on GitHub ↗
(
  email?: string,
)

Source from the content-addressed store, hash-verified

32// here keeps a value set after init (a signup in this session) from going out
33// in plain text.
34export const hashEmailForMeta = async (
35 email?: string,
36): Promise<string | undefined> => {
37 const normalized = email?.trim().toLowerCase();
38
39 if (!normalized || !globalThis.crypto?.subtle) {
40 return undefined;
41 }
42
43 const digest = await globalThis.crypto.subtle.digest(
44 'SHA-256',
45 new TextEncoder().encode(normalized),
46 );
47
48 return Array.from(new Uint8Array(digest))
49 .map((byte) => byte.toString(16).padStart(2, '0'))
50 .join('');
51};
52
53const FbTracking = ({ userId, consent, email }: PixelProps): ReactElement => {
54 useEffect(() => {

Callers 2

trackSignupFunction · 0.90
FbTrackingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected