MCPcopy Create free account
hub / github.com/DeepNotesApp/DeepNotes / getDeviceHash

Function getDeviceHash

apps/app-server/src/utils/crypto.ts:55–67  ·  view source on GitHub ↗
(input: {
  ip: string;
  userAgent: string;
  userId: string;
})

Source from the content-addressed store, hash-verified

53}
54
55export function getDeviceHash(input: {
56 ip: string;
57 userAgent: string;
58 userId: string;
59}) {
60 return Buffer.from(
61 sodium.crypto_generichash(
62 16,
63 `${input.ip} ${input.userAgent}`,
64 nanoidToBytes(input.userId),
65 ),
66 );
67}
68
69// User rehashed login hash
70

Callers 1

getUserDeviceFunction · 0.90

Calls 1

nanoidToBytesFunction · 0.90

Tested by

no test coverage detected